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
This commit is contained in:
tonihei 2020-01-16 11:46:26 +00:00 committed by Oliver Woodman
parent 17d1343375
commit 8d2fd383f9

View File

@ -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