forked from j62/ctbrec
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:
parent
80cafbb47d
commit
1c5bcaef35
|
@ -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");
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue