forked from j62/ctbrec
1
0
Fork 0

Make sure the streamer is stopped

The streamer has to be stopped, when the download is stopped or
terminates to release the file handle of the recording and to stop
the merge thread
This commit is contained in:
0xboobface 2018-09-09 14:30:21 +02:00
parent 80cafbb47d
commit 1c5bcaef35
1 changed files with 3 additions and 1 deletions

View File

@ -65,6 +65,7 @@ public class MergedHlsDownload extends AbstractHlsDownload {
throw new IOException("Couldn't parse HLS playlist", e);
} finally {
alive = false;
streamer.stop();
LOG.debug("Download for terminated");
}
}
@ -107,6 +108,7 @@ public class MergedHlsDownload extends AbstractHlsDownload {
throw new IOException("Couldn't download segment", e);
} finally {
alive = false;
streamer.stop();
LOG.debug("Download for {} terminated", model);
}
}
@ -159,7 +161,6 @@ public class MergedHlsDownload extends AbstractHlsDownload {
if(livestreamDownload) {
while(!mergeQueue.isEmpty()) {
try {
LOG.debug("Writing segment");
writeSegment(mergeQueue.poll());
} catch (InterruptedException e) {
if(running) {
@ -209,6 +210,7 @@ public class MergedHlsDownload extends AbstractHlsDownload {
public void stop() {
running = false;
alive = false;
streamer.stop();
LOG.debug("Download stopped");
}