From 454d4add4a27fee75c2d8f97cbb802ee27c6decd Mon Sep 17 00:00:00 2001 From: tonihei Date: Thu, 23 Jan 2020 14:23:28 +0000 Subject: [PATCH] Remove unused code path The deleted path was only used if resetPosition=false and clearPlaylist=true, which is never the case. PiperOrigin-RevId: 291154550 --- .../android/exoplayer2/ExoPlayerImplInternal.java | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/library/core/src/main/java/com/google/android/exoplayer2/ExoPlayerImplInternal.java b/library/core/src/main/java/com/google/android/exoplayer2/ExoPlayerImplInternal.java index 194fd89083..9f9fed6abf 100644 --- a/library/core/src/main/java/com/google/android/exoplayer2/ExoPlayerImplInternal.java +++ b/library/core/src/main/java/com/google/android/exoplayer2/ExoPlayerImplInternal.java @@ -1125,20 +1125,6 @@ import java.util.concurrent.atomic.AtomicBoolean; } 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(); shouldContinueLoading = false; Timeline timeline = playbackInfo.timeline; @@ -1155,6 +1141,7 @@ import java.util.concurrent.atomic.AtomicBoolean; long contentPositionUs = playbackInfo.contentPositionUs; boolean resetTrackInfo = clearPlaylist; if (resetPosition) { + pendingInitialSeekPosition = null; Pair firstPeriodAndPosition = getDummyFirstMediaPeriodPosition(); mediaPeriodId = firstPeriodAndPosition.first; startPositionUs = firstPeriodAndPosition.second;