From da02bc73e8083028989266434cc1d49ed7c16fbb Mon Sep 17 00:00:00 2001 From: tonihei Date: Wed, 5 Feb 2020 13:07:05 +0000 Subject: [PATCH] Add missing getPeriod call to populate period. The period in this method is most likely prepopulated correctly, but this assumption is very error-prone and we should populate it locally. PiperOrigin-RevId: 293345873 --- .../java/com/google/android/exoplayer2/MediaPeriodQueue.java | 1 + 1 file changed, 1 insertion(+) diff --git a/library/core/src/main/java/com/google/android/exoplayer2/MediaPeriodQueue.java b/library/core/src/main/java/com/google/android/exoplayer2/MediaPeriodQueue.java index d595564744..e97c3ee489 100644 --- a/library/core/src/main/java/com/google/android/exoplayer2/MediaPeriodQueue.java +++ b/library/core/src/main/java/com/google/android/exoplayer2/MediaPeriodQueue.java @@ -744,6 +744,7 @@ import com.google.android.exoplayer2.util.Assertions; long startPositionUs, long requestedContentPositionUs, long windowSequenceNumber) { + timeline.getPeriodByUid(periodUid, period); int nextAdGroupIndex = period.getAdGroupIndexAfterPositionUs(startPositionUs); MediaPeriodId id = new MediaPeriodId(periodUid, windowSequenceNumber, nextAdGroupIndex); boolean isLastInPeriod = isLastInPeriod(id);