Skip to content

Commit

Permalink
fix: Revert change that caused a lot of warning with "cannot find end…
Browse files Browse the repository at this point in the history
…Time" and hls playback errors (#7239)

Reverts #7184 ("fix:
Add null check for current reference")

See
#7184 (comment)
  • Loading branch information
avelad authored Aug 30, 2024
1 parent cd2fc71 commit e522921
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions lib/media/streaming_engine.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 ?
Expand Down

0 comments on commit e522921

Please sign in to comment.