From 3202d5d2cda05f6e4b8e94f8b33004195f9ad7ec Mon Sep 17 00:00:00 2001 From: 0xb00bface <0xboobface@gmail.com> Date: Sat, 23 Jan 2021 13:13:25 +0100 Subject: [PATCH] Call stop() instead of setting running=false --- .../recorder/download/hls/AbstractHlsDownload.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/common/src/main/java/ctbrec/recorder/download/hls/AbstractHlsDownload.java b/common/src/main/java/ctbrec/recorder/download/hls/AbstractHlsDownload.java index ce0bdd3a..3603a9e3 100644 --- a/common/src/main/java/ctbrec/recorder/download/hls/AbstractHlsDownload.java +++ b/common/src/main/java/ctbrec/recorder/download/hls/AbstractHlsDownload.java @@ -117,21 +117,21 @@ public abstract class AbstractHlsDownload extends AbstractDownload { } } catch (ParseException e) { LOG.error("Couldn't parse HLS playlist for model {}\n{}", model, e.getInput(), e); - running = false; + stop(); } catch (PlaylistException e) { LOG.error("Couldn't parse HLS playlist for model {}", model, e); - running = false; + stop(); } catch (PlaylistTimeoutException e) { rescheduleTime = beforeLastPlaylistRequest; // try again as fast as possible } catch (EOFException e) { // end of playlist reached LOG.debug("Reached end of playlist for model {}", model); - running = false; + stop(); } catch (HttpException e) { handleHttpException(e); } catch (Exception e) { LOG.error("Couldn't download segment for model {}", model, e); - running = false; + stop(); } return this; } @@ -158,7 +158,7 @@ public abstract class AbstractHlsDownload extends AbstractDownload { } else { if (consecutivePlaylistErrors >= 3) { LOG.info("Playlist couldn't not be downloaded for model {} {} times. Stopping recording", model, (consecutivePlaylistErrors + 1), e); - running = false; + stop(); } else { 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 { modelState = model.getOnlineState(false); if (modelState != State.ONLINE) { - running = false; + stop(); } } catch (ExecutionException e1) { modelState = State.UNKNOWN;