Skip to content

Commit 73117f0

Browse files
authored
revert: Fix potential AV sync issues after seek or adaptation (#6435)
This reverts #4886, which was found to cause issues with fetching segments after seeking. Closes #5785 Re-open #4589
1 parent 17df192 commit 73117f0

File tree

1 file changed

+1
-13
lines changed

1 file changed

+1
-13
lines changed

lib/media/streaming_engine.js

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -947,7 +947,6 @@ shaka.media.StreamingEngine = class {
947947
// The playhead might be seeking on startup, if a start time is set, so
948948
// start "seeked" as true.
949949
seeked: true,
950-
needsResync: false,
951950
recovering: false,
952951
hasError: false,
953952
operation: null,
@@ -1417,11 +1416,6 @@ shaka.media.StreamingEngine = class {
14171416
shaka.log.v1(
14181417
logPrefix, 'looking up segment from new stream endTime:', time);
14191418

1420-
// Using a new iterator means we need to resync the stream in sequence
1421-
// mode. The buffered range might not align perfectly with the last
1422-
// segment end time, so we may end up repeating a segment. Resyncing
1423-
// makes this safe to do.
1424-
mediaState.needsResync = true;
14251419
mediaState.segmentIterator =
14261420
mediaState.stream.segmentIndex.getIteratorForTime(time);
14271421
const ref = mediaState.segmentIterator &&
@@ -2062,9 +2056,7 @@ shaka.media.StreamingEngine = class {
20622056
// Across discontinuity bounds, we should resync timestamps for
20632057
// sequence mode playbacks. The next segment appended should
20642058
// land at its theoretical timestamp from the segment index.
2065-
if (reference.discontinuitySequence != lastDiscontinuitySequence ||
2066-
mediaState.needsResync) {
2067-
mediaState.needsResync = false;
2059+
if (reference.discontinuitySequence != lastDiscontinuitySequence) {
20682060
operations.push(this.playerInterface_.mediaSourceEngine.resync(
20692061
mediaState.type, reference.startTime));
20702062
}
@@ -2792,7 +2784,6 @@ shaka.media.StreamingEngine.PlayerInterface;
27922784
* clearBufferSafeMargin: number,
27932785
* clearingBuffer: boolean,
27942786
* seeked: boolean,
2795-
* needsResync: boolean,
27962787
* adaptation: boolean,
27972788
* recovering: boolean,
27982789
* hasError: boolean,
@@ -2847,9 +2838,6 @@ shaka.media.StreamingEngine.PlayerInterface;
28472838
* True indicates that the presentation just seeked.
28482839
* @property {boolean} adaptation
28492840
* True indicates that the presentation just automatically switched variants.
2850-
* @property {boolean} needsResync
2851-
* True indicates that the stream needs to be resynced in sequence mode,
2852-
* regardless of discontinuity sequence.
28532841
* @property {boolean} recovering
28542842
* True indicates that the last segment was not appended because it could not
28552843
* fit in the buffer.

0 commit comments

Comments
 (0)