Commit 454d4add by tonihei Committed by Ian Baker

Remove unused code path

The deleted path was only used if resetPosition=false and clearPlaylist=true,
which is never the case.

PiperOrigin-RevId: 291154550
parent 23f316d6
...@@ -1125,20 +1125,6 @@ import java.util.concurrent.atomic.AtomicBoolean; ...@@ -1125,20 +1125,6 @@ import java.util.concurrent.atomic.AtomicBoolean;
} }
enabledRenderers = new Renderer[0]; enabledRenderers = new Renderer[0];
if (resetPosition) {
pendingInitialSeekPosition = null;
} else if (clearPlaylist) {
// When clearing the playlist, also reset the period-based PlaybackInfo position and convert
// existing position to initial seek instead.
resetPosition = true;
if (pendingInitialSeekPosition == null && !playbackInfo.timeline.isEmpty()) {
playbackInfo.timeline.getPeriodByUid(playbackInfo.periodId.periodUid, period);
long windowPositionUs = playbackInfo.positionUs + period.getPositionInWindowUs();
pendingInitialSeekPosition =
new SeekPosition(Timeline.EMPTY, period.windowIndex, windowPositionUs);
}
}
queue.clear(); queue.clear();
shouldContinueLoading = false; shouldContinueLoading = false;
Timeline timeline = playbackInfo.timeline; Timeline timeline = playbackInfo.timeline;
...@@ -1155,6 +1141,7 @@ import java.util.concurrent.atomic.AtomicBoolean; ...@@ -1155,6 +1141,7 @@ import java.util.concurrent.atomic.AtomicBoolean;
long contentPositionUs = playbackInfo.contentPositionUs; long contentPositionUs = playbackInfo.contentPositionUs;
boolean resetTrackInfo = clearPlaylist; boolean resetTrackInfo = clearPlaylist;
if (resetPosition) { if (resetPosition) {
pendingInitialSeekPosition = null;
Pair<MediaPeriodId, Long> firstPeriodAndPosition = getDummyFirstMediaPeriodPosition(); Pair<MediaPeriodId, Long> firstPeriodAndPosition = getDummyFirstMediaPeriodPosition();
mediaPeriodId = firstPeriodAndPosition.first; mediaPeriodId = firstPeriodAndPosition.first;
startPositionUs = firstPeriodAndPosition.second; startPositionUs = firstPeriodAndPosition.second;
......
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