Call stop() instead of setting running=false

This commit is contained in:
0xb00bface 2021-01-23 13:13:25 +01:00
parent e9a71bd6f1
commit 3202d5d2cd
1 changed files with 6 additions and 6 deletions

View File

@ -117,21 +117,21 @@ public abstract class AbstractHlsDownload extends AbstractDownload {
} }
} catch (ParseException e) { } catch (ParseException e) {
LOG.error("Couldn't parse HLS playlist for model {}\n{}", model, e.getInput(), e); LOG.error("Couldn't parse HLS playlist for model {}\n{}", model, e.getInput(), e);
running = false; stop();
} catch (PlaylistException e) { } catch (PlaylistException e) {
LOG.error("Couldn't parse HLS playlist for model {}", model, e); LOG.error("Couldn't parse HLS playlist for model {}", model, e);
running = false; stop();
} catch (PlaylistTimeoutException e) { } catch (PlaylistTimeoutException e) {
rescheduleTime = beforeLastPlaylistRequest; // try again as fast as possible rescheduleTime = beforeLastPlaylistRequest; // try again as fast as possible
} catch (EOFException e) { } catch (EOFException e) {
// end of playlist reached // end of playlist reached
LOG.debug("Reached end of playlist for model {}", model); LOG.debug("Reached end of playlist for model {}", model);
running = false; stop();
} catch (HttpException e) { } catch (HttpException e) {
handleHttpException(e); handleHttpException(e);
} catch (Exception e) { } catch (Exception e) {
LOG.error("Couldn't download segment for model {}", model, e); LOG.error("Couldn't download segment for model {}", model, e);
running = false; stop();
} }
return this; return this;
} }
@ -158,7 +158,7 @@ public abstract class AbstractHlsDownload extends AbstractDownload {
} else { } else {
if (consecutivePlaylistErrors >= 3) { if (consecutivePlaylistErrors >= 3) {
LOG.info("Playlist couldn't not be downloaded for model {} {} times. Stopping recording", model, (consecutivePlaylistErrors + 1), e); LOG.info("Playlist couldn't not be downloaded for model {} {} times. Stopping recording", model, (consecutivePlaylistErrors + 1), e);
running = false; stop();
} else { } else {
LOG.info("Playlist couldn't not be downloaded for model {} {} times: {}", model, (consecutivePlaylistErrors + 1), e.getLocalizedMessage()); LOG.info("Playlist couldn't not be downloaded for model {} {} times: {}", model, (consecutivePlaylistErrors + 1), e.getLocalizedMessage());
} }
@ -170,7 +170,7 @@ public abstract class AbstractHlsDownload extends AbstractDownload {
try { try {
modelState = model.getOnlineState(false); modelState = model.getOnlineState(false);
if (modelState != State.ONLINE) { if (modelState != State.ONLINE) {
running = false; stop();
} }
} catch (ExecutionException e1) { } catch (ExecutionException e1) {
modelState = State.UNKNOWN; modelState = State.UNKNOWN;