Skip to content

Commit

Permalink
BufferController: fix issue in adjustSeekTarget after a track switch (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
bbert authored Feb 8, 2022
1 parent af17c3c commit e263c71
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/streaming/controllers/BufferController.js
Original file line number Diff line number Diff line change
Expand Up @@ -335,15 +335,16 @@ function BufferController(config) {

// Check if current buffered range already contains seek target (and current video element time)
const currentTime = playbackController.getTime();
let range = getRangeAt(seekTarget, 0);
if (currentTime === seekTarget && range) {
const rangeAtCurrenTime = getRangeAt(currentTime, 0);
const rangeAtSeekTarget = getRangeAt(seekTarget, 0);
if (rangeAtCurrenTime && rangeAtSeekTarget && rangeAtCurrenTime.start === rangeAtSeekTarget.start) {
seekTarget = NaN;
return;
}

// Get buffered range corresponding to the seek target
const segmentDuration = representationController.getCurrentRepresentation().segmentDuration;
range = getRangeAt(seekTarget, segmentDuration);
const range = getRangeAt(seekTarget, segmentDuration);
if (!range) return;

if (settings.get().streaming.buffer.enableSeekDecorrelationFix && Math.abs(currentTime - seekTarget) > segmentDuration) {
Expand Down

0 comments on commit e263c71

Please sign in to comment.