Skip to content

Commit

Permalink
revert: Fix potential AV sync issues after seek or adaptation (#6435)
Browse files Browse the repository at this point in the history
This reverts #4886, which was found to cause issues with fetching segments after seeking.

Closes #5785
Re-open #4589
  • Loading branch information
avelad committed Apr 15, 2024
1 parent 96d15b9 commit cbbb704
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions lib/media/streaming_engine.js
Expand Up @@ -881,7 +881,6 @@ shaka.media.StreamingEngine = class {
// The playhead might be seeking on startup, if a start time is set, so
// start "seeked" as true.
seeked: true,
needsResync: false,
recovering: false,
hasError: false,
operation: null,
Expand Down Expand Up @@ -1248,11 +1247,6 @@ shaka.media.StreamingEngine = class {
shaka.log.v1(
logPrefix, 'looking up segment from new stream endTime:', time);

// Using a new iterator means we need to resync the stream in sequence
// mode. The buffered range might not align perfectly with the last
// segment end time, so we may end up repeating a segment. Resyncing
// makes this safe to do.
mediaState.needsResync = true;
mediaState.segmentIterator =
mediaState.stream.segmentIndex.getIteratorForTime(time);
const ref = mediaState.segmentIterator &&
Expand Down Expand Up @@ -1879,9 +1873,7 @@ shaka.media.StreamingEngine = class {
// Across discontinuity bounds, we should resync timestamps for
// sequence mode playbacks. The next segment appended should
// land at its theoretical timestamp from the segment index.
if (reference.discontinuitySequence != lastDiscontinuitySequence ||
mediaState.needsResync) {
mediaState.needsResync = false;
if (reference.discontinuitySequence != lastDiscontinuitySequence) {
operations.push(this.playerInterface_.mediaSourceEngine.resync(
mediaState.type, reference.startTime));
}
Expand Down Expand Up @@ -2591,7 +2583,6 @@ shaka.media.StreamingEngine.PlayerInterface;
* clearBufferSafeMargin: number,
* clearingBuffer: boolean,
* seeked: boolean,
* needsResync: boolean,
* adaptation: boolean,
* recovering: boolean,
* hasError: boolean,
Expand Down Expand Up @@ -2646,9 +2637,6 @@ shaka.media.StreamingEngine.PlayerInterface;
* True indicates that the presentation just seeked.
* @property {boolean} adaptation
* True indicates that the presentation just automatically switched variants.
* @property {boolean} needsResync
* True indicates that the stream needs to be resynced in sequence mode,
* regardless of discontinuity sequence.
* @property {boolean} recovering
* True indicates that the last segment was not appended because it could not
* fit in the buffer.
Expand Down

0 comments on commit cbbb704

Please sign in to comment.