Stop download if the playlist request timed out 5 times
This commit is contained in:
parent
10321f32bd
commit
e789ce2029
|
@ -132,7 +132,11 @@ public abstract class AbstractHlsDownload extends AbstractDownload {
|
|||
LOG.error("Couldn't parse HLS playlist for model {}", model, e);
|
||||
stop();
|
||||
} catch (PlaylistTimeoutException e) {
|
||||
rescheduleTime = beforeLastPlaylistRequest; // try again as fast as possible
|
||||
if (consecutivePlaylistTimeouts >= 5) {
|
||||
stop();
|
||||
} else {
|
||||
rescheduleTime = beforeLastPlaylistRequest; // try again as fast as possible
|
||||
}
|
||||
} catch (EOFException e) {
|
||||
// end of playlist reached
|
||||
LOG.debug("Reached end of playlist for model {}", model);
|
||||
|
@ -179,10 +183,12 @@ public abstract class AbstractHlsDownload extends AbstractDownload {
|
|||
ctbrec.Model.State modelState;
|
||||
try {
|
||||
modelState = model.getOnlineState(false);
|
||||
if (modelState != State.ONLINE) {
|
||||
if (modelState == State.ONLINE) {
|
||||
segmentPlaylistUrl = getSegmentPlaylistUrl(model);
|
||||
} else {
|
||||
stop();
|
||||
}
|
||||
} catch (ExecutionException e1) {
|
||||
} catch (Exception e1) {
|
||||
modelState = State.UNKNOWN;
|
||||
}
|
||||
LOG.info(errorMsg, model, modelState);
|
||||
|
|
Loading…
Reference in New Issue