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 ?