From 8d2fd383f95e29794869baf7bf1a7061163bd3a5 Mon Sep 17 00:00:00 2001 From: tonihei Date: Thu, 16 Jan 2020 11:46:26 +0000 Subject: [PATCH] Fix setting maskingPeriodIndex in ExoPlayerImpl Whenever we set the maskingWindowIndex, we also need to set the masking period index and the masking position. Otherwise it may cause exception when the period index is used together with the masking timeline. PiperOrigin-RevId: 290036973 --- .../main/java/com/google/android/exoplayer2/ExoPlayerImpl.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/library/core/src/main/java/com/google/android/exoplayer2/ExoPlayerImpl.java b/library/core/src/main/java/com/google/android/exoplayer2/ExoPlayerImpl.java index 0f3e1d98ab..70dc42709f 100644 --- a/library/core/src/main/java/com/google/android/exoplayer2/ExoPlayerImpl.java +++ b/library/core/src/main/java/com/google/android/exoplayer2/ExoPlayerImpl.java @@ -1029,6 +1029,8 @@ import java.util.concurrent.TimeoutException; if (maskingTimeline.getIndexOfPeriod(periodUid) != C.INDEX_UNSET) { // Get the window index of the current period that exists in the new timeline also. maskingWindowIndex = maskingTimeline.getPeriodByUid(periodUid, period).windowIndex; + maskingPeriodIndex = maskingTimeline.getIndexOfPeriod(periodUid); + maskingWindowPositionMs = currentPositionMs; } else { // Period uid not found in new timeline. Try to get subsequent period. @Nullable