Always update loading period in handleSourceInfoRefreshed.

This ensures we keep the loading period in sync with the the playing period in
PlybackInfo, when the latter changes to something new.

PiperOrigin-RevId: 244838123
This commit is contained in:
tonihei 2019-04-23 13:35:58 +01:00 committed by Oliver Woodman
parent 3e9a45b9d3
commit 9441f72445

View File

@ -1321,7 +1321,6 @@ import java.util.concurrent.atomic.AtomicBoolean;
if (!queue.updateQueuedPeriods(rendererPositionUs, getMaxRendererReadPositionUs())) {
seekToCurrentPosition(/* sendDiscontinuity= */ false);
}
handleLoadingMediaPeriodChanged(/* loadingTrackSelectionChanged= */ false);
} else {
// Something changed. Seek to new start position.
MediaPeriodHolder periodHolder = queue.getFrontPeriod();
@ -1341,6 +1340,7 @@ import java.util.concurrent.atomic.AtomicBoolean;
playbackInfo.copyWithNewPosition(
newPeriodId, seekedToPositionUs, newContentPositionUs, getTotalBufferedDurationUs());
}
handleLoadingMediaPeriodChanged(/* loadingTrackSelectionChanged= */ false);
}
private long getMaxRendererReadPositionUs() {