forked from j62/ctbrec
1
0
Fork 0

Add updates of lastSegmentDownload to MergedFfmpegHlsDownload

This commit is contained in:
0xb00bface 2021-12-21 22:08:38 +01:00
parent f92cdf46b6
commit f9d777b039
2 changed files with 3 additions and 2 deletions

View File

@ -69,7 +69,7 @@ public abstract class AbstractHlsDownload extends AbstractDownload {
private Instant beforeLastPlaylistRequest= Instant.EPOCH; private Instant beforeLastPlaylistRequest= Instant.EPOCH;
private int consecutivePlaylistTimeouts = 0; private int consecutivePlaylistTimeouts = 0;
private int consecutivePlaylistErrors = 0; private int consecutivePlaylistErrors = 0;
private Instant lastSegmentDownload = Instant.MIN; protected Instant lastSegmentDownload = Instant.MIN;
private final List<Instant> segmentErrorTimestamps = new LinkedList<>(); private final List<Instant> segmentErrorTimestamps = new LinkedList<>();
private int selectedResolution = UNKNOWN; private int selectedResolution = UNKNOWN;

View File

@ -86,6 +86,7 @@ public class MergedFfmpegHlsDownload extends AbstractHlsDownload {
SegmentDownload segmentDownload = future.get(); SegmentDownload segmentDownload = future.get();
ByteArrayOutputStream downloadData = (ByteArrayOutputStream) segmentDownload.getOutputStream(); ByteArrayOutputStream downloadData = (ByteArrayOutputStream) segmentDownload.getOutputStream();
downloadData.writeTo(ffmpegStdIn); downloadData.writeTo(ffmpegStdIn);
lastSegmentDownload = Instant.now();
} else { } else {
// first download in queue not finished, let's continue with other stuff // first download in queue not finished, let's continue with other stuff
break; break;
@ -213,7 +214,7 @@ public class MergedFfmpegHlsDownload extends AbstractHlsDownload {
} }
@Override @Override
protected OutputStream getSegmentOutputStream(Segment segment) throws IOException { protected OutputStream getSegmentOutputStream(Segment segment) {
return new ByteArrayOutputStream(); return new ByteArrayOutputStream();
} }
} }