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
This commit is contained in:
parent
4b0e39e4b9
commit
996e58973d
@ -733,12 +733,14 @@ import java.util.concurrent.atomic.AtomicBoolean;
|
||||
private void setPauseAtEndOfWindowInternal(boolean pauseAtEndOfWindow)
|
||||
throws ExoPlaybackException {
|
||||
this.pauseAtEndOfWindow = pauseAtEndOfWindow;
|
||||
if (queue.getReadingPeriod() != queue.getPlayingPeriod()) {
|
||||
seekToCurrentPosition(/* sendDiscontinuity= */ true);
|
||||
}
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
private void setOffloadSchedulingEnabledInternal(boolean offloadSchedulingEnabled) {
|
||||
if (offloadSchedulingEnabled == this.offloadSchedulingEnabled) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user