Improve detection of stream termination
This commit is contained in:
parent
c05785cd20
commit
9462a31111
|
@ -42,8 +42,10 @@ public class ShowupMergedDownload extends MergedFfmpegHlsDownload {
|
||||||
InputStream in = response.body().byteStream();
|
InputStream in = response.body().byteStream();
|
||||||
byte[] buffer = new byte[10240];
|
byte[] buffer = new byte[10240];
|
||||||
int length = -1;
|
int length = -1;
|
||||||
while ((length = in.read(buffer)) >= 0 && running && !Thread.interrupted()) {
|
boolean keepGoing = true;
|
||||||
|
while ((length = in.read(buffer)) >= 0 && keepGoing) {
|
||||||
writeSegment(buffer, 0, length);
|
writeSegment(buffer, 0, length);
|
||||||
|
keepGoing = running && !Thread.interrupted() && model.isOnline(true);
|
||||||
if (livestreamDownload && splitRecording()) {
|
if (livestreamDownload && splitRecording()) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue