From 7c8c54f7558a9c22b8299d249ddbc9e06161323e Mon Sep 17 00:00:00 2001 From: dsilhavy Date: Sat, 20 Nov 2021 10:00:22 +0100 Subject: [PATCH 1/2] Adjust time check in TimelineSegmentsGetter.js. We also need to consider if the requiredMediaTime is larger than the start time of the segment. --- src/dash/utils/TimelineSegmentsGetter.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dash/utils/TimelineSegmentsGetter.js b/src/dash/utils/TimelineSegmentsGetter.js index 3e6bfb837b..ea389e0300 100644 --- a/src/dash/utils/TimelineSegmentsGetter.js +++ b/src/dash/utils/TimelineSegmentsGetter.js @@ -253,7 +253,7 @@ function TimelineSegmentsGetter(config, isDynamic) { // In some cases when requiredMediaTime = actual end time of the last segment // it is possible that this time a bit exceeds the declared end time of the last segment. // in this case we still need to include the last segment in the segment list. - if (requiredMediaTime < (scaledTime + (frag.d / fTimescale))) { + if ((requiredMediaTime < (scaledTime + (frag.d / fTimescale))) && requiredMediaTime >= scaledTime) { let media = base.media; let mediaRange = frag.mediaRange; From 54041dff386a714799adc1c22c6d60f33be10e62 Mon Sep 17 00:00:00 2001 From: dsilhavy Date: Sat, 20 Nov 2021 10:00:54 +0100 Subject: [PATCH 2/2] Account for seek to 0 in _noMediaRequestGenerated --- src/streaming/StreamProcessor.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/streaming/StreamProcessor.js b/src/streaming/StreamProcessor.js index 41d6fea7f8..a5d841c396 100644 --- a/src/streaming/StreamProcessor.js +++ b/src/streaming/StreamProcessor.js @@ -436,7 +436,7 @@ function StreamProcessor(config) { // If this statement is true we are stuck. A static manifest does not change and we did not find a valid request for the target time // There is no point in trying again. We need to adjust the time in order to find a valid request. This can happen if the user/app seeked into a gap. - if (settings.get().streaming.gaps.enableSeekFix && !isDynamic && shouldUseExplicitTimeForRequest && playbackController.isSeeking()) { + if (settings.get().streaming.gaps.enableSeekFix && !isDynamic && shouldUseExplicitTimeForRequest && (playbackController.isSeeking() || playbackController.getTime() === 0)) { const adjustedTime = dashHandler.getValidSeekTimeCloseToTargetTime(bufferingTime, mediaInfo, representation, settings.get().streaming.gaps.threshold); if (!isNaN(adjustedTime)) { playbackController.seek(adjustedTime, false, false);