Fix potentially wrong window index in onMediaPeriodCreated.

Issue:#6776
This commit is contained in:
tonihei 2019-12-20 16:38:34 +00:00 committed by GitHub
parent c6036d5271
commit 5d728abc41
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -806,7 +806,10 @@ public class AnalyticsCollector
public void onMediaPeriodCreated(int windowIndex, MediaPeriodId mediaPeriodId) {
boolean isInTimeline = timeline.getIndexOfPeriod(mediaPeriodId.periodUid) != C.INDEX_UNSET;
MediaPeriodInfo mediaPeriodInfo =
new MediaPeriodInfo(mediaPeriodId, isInTimeline ? timeline : Timeline.EMPTY, windowIndex);
new MediaPeriodInfo(
mediaPeriodId,
isInTimeline ? timeline : Timeline.EMPTY,
isInTimeline ? timeline.getPeriod(periodIndex, period).windowIndex : windowIndex);
mediaPeriodInfoQueue.add(mediaPeriodInfo);
mediaPeriodIdToInfo.put(mediaPeriodId, mediaPeriodInfo);
lastPlayingMediaPeriod = mediaPeriodInfoQueue.get(0);