From c0e633fbe118878c778bfa1fe7c2efccac1b0e22 Mon Sep 17 00:00:00 2001 From: bachinger Date: Tue, 12 Nov 2019 15:32:57 +0000 Subject: [PATCH] use getPeriodByUid when searching for subsequent period of seek timeline Issue: #6641 PiperOrigin-RevId: 279963739 --- .../google/android/exoplayer2/ExoPlayerImplInternal.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 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 b6ac22059f..3a34fc14b5 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 @@ -1433,6 +1433,7 @@ import java.util.concurrent.atomic.AtomicBoolean; * @throws IllegalSeekPositionException If the window index of the seek position is outside the * bounds of the timeline. */ + @Nullable private Pair resolveSeekPosition( SeekPosition seekPosition, boolean trySubsequentPeriods) { Timeline timeline = playbackInfo.timeline; @@ -1467,11 +1468,12 @@ import java.util.concurrent.atomic.AtomicBoolean; } if (trySubsequentPeriods) { // Try and find a subsequent period from the seek timeline in the internal timeline. + @Nullable Object periodUid = resolveSubsequentPeriod(periodPosition.first, seekTimeline, timeline); if (periodUid != null) { - // We found one. Map the SeekPosition onto the corresponding default position. + // We found one. Use the default position of the corresponding window. return getPeriodPosition( - timeline, timeline.getPeriod(periodIndex, period).windowIndex, C.TIME_UNSET); + timeline, timeline.getPeriodByUid(periodUid, period).windowIndex, C.TIME_UNSET); } } // We didn't find one. Give up.