Skip to content

Commit

Permalink
fix: Don't clear the buffer when disable a stream (#6931)
Browse files Browse the repository at this point in the history
  • Loading branch information
avelad committed Jul 1, 2024
1 parent 190fa3f commit 53a1147
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions lib/media/streaming_engine.js
Original file line number Diff line number Diff line change
Expand Up @@ -613,6 +613,10 @@ shaka.media.StreamingEngine = class {
}
});
}
} else {
if (!mediaState.performingUpdate && !mediaState.updateTimer) {
this.scheduleUpdate_(mediaState, 0);
}
}

this.makeAbortDecision_(mediaState).catch((error) => {
Expand Down
4 changes: 2 additions & 2 deletions lib/player.js
Original file line number Diff line number Diff line change
Expand Up @@ -6476,7 +6476,7 @@ shaka.Player = class extends shaka.util.FakeEventTarget {
if (hasVariantUpdate) {
// Reconsider re-enabled variant for ABR switching.
this.chooseVariantAndSwitch_(
/* clearBuffer= */ true, /* safeMargin= */ undefined,
/* clearBuffer= */ false, /* safeMargin= */ undefined,
/* force= */ false, /* fromAdaptation= */ false);
}
}
Expand Down Expand Up @@ -6937,7 +6937,7 @@ shaka.Player = class extends shaka.util.FakeEventTarget {

// Update abr manager variants and switch to recover playback
this.chooseVariantAndSwitch_(
/* clearBuffer= */ true, /* safeMargin= */ safeMargin,
/* clearBuffer= */ false, /* safeMargin= */ safeMargin,
/* force= */ true, /* fromAdaptation= */ false);
return true;
}
Expand Down

0 comments on commit 53a1147

Please sign in to comment.