Commit 996e5897 by tonihei Committed by kim-vde

Make renderer flush when setting pause-at-end more targeted.

We currently always reset everything if playingPeriod != readingPeriod.
However, this is only needed when the pausing is actually required, i.e.,
if the feature is enabled and we are in the last period of the window.

PiperOrigin-RevId: 328141242
parent 4b0e39e4
......@@ -733,11 +733,13 @@ import java.util.concurrent.atomic.AtomicBoolean;
private void setPauseAtEndOfWindowInternal(boolean pauseAtEndOfWindow)
throws ExoPlaybackException {
this.pauseAtEndOfWindow = pauseAtEndOfWindow;
if (queue.getReadingPeriod() != queue.getPlayingPeriod()) {
resetPendingPauseAtEndOfPeriod();
if (pendingPauseAtEndOfPeriod && queue.getReadingPeriod() != queue.getPlayingPeriod()) {
// When pausing is required, we need to set the streams of the playing period final. If we
// already started reading the next period, we need to flush the renderers.
seekToCurrentPosition(/* sendDiscontinuity= */ true);
handleLoadingMediaPeriodChanged(/* loadingTrackSelectionChanged= */ false);
}
resetPendingPauseAtEndOfPeriod();
handleLoadingMediaPeriodChanged(/* loadingTrackSelectionChanged= */ false);
}
private void setOffloadSchedulingEnabledInternal(boolean offloadSchedulingEnabled) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment