From 5774aeada35cd435fd37dc44c84b15a7b4bab938 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Velad=20Galv=C3=A1n?= Date: Fri, 30 Aug 2024 08:05:46 +0200 Subject: [PATCH] fix: Revert change that caused a lot of warning with "cannot find endTime" and hls playback errors (#7239) Reverts https://github.com/shaka-project/shaka-player/pull/7184 ("fix: Add null check for current reference") See https://github.com/shaka-project/shaka-player/pull/7184#issuecomment-2317424817 --- lib/media/streaming_engine.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/lib/media/streaming_engine.js b/lib/media/streaming_engine.js index 1f2441bfff..9884c57432 100644 --- a/lib/media/streaming_engine.js +++ b/lib/media/streaming_engine.js @@ -1503,14 +1503,11 @@ shaka.media.StreamingEngine = class { mediaState.stream.segmentIndex, 'segment index should have been generated already'); - const currentSegment = mediaState.segmentIterator ? - mediaState.segmentIterator.current() : null; - - if (currentSegment) { + if (mediaState.segmentIterator) { // Something is buffered from the same Stream. Use the current position // in the segment index. This is updated via next() after each segment is // appended. - return currentSegment; + return mediaState.segmentIterator.current(); } else if (mediaState.lastSegmentReference || bufferEnd) { // Something is buffered from another Stream. const time = mediaState.lastSegmentReference ?