Skip to content

Commit

Permalink
fix: Fix change timestampOffset on discontinuities when not necessary (
Browse files Browse the repository at this point in the history
…#7823)

This change fixes a bug in a Safari test
  • Loading branch information
avelad authored and joeyparrish committed Jan 6, 2025
1 parent 19d94ef commit a25dab0
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/media/media_source_engine.js
Original file line number Diff line number Diff line change
Expand Up @@ -1350,6 +1350,13 @@ shaka.media.MediaSourceEngine = class {
return;
}

// Avoid changing timestampOffset when the difference is less than 100 ms
// from the end of the current buffer.
const bufferEnd = this.bufferEnd(contentType);
if (bufferEnd && Math.abs(bufferEnd - timestampOffset) < 0.1) {
return;
}

// Queue an abort() to help MSE splice together overlapping segments.
// We set appendWindowEnd when we change periods in DASH content, and the
// period transition may result in overlap.
Expand Down

0 comments on commit a25dab0

Please sign in to comment.