Commit eb3a31c8 by andrewlewis Committed by Oliver Woodman

Fix default position masking period index calculation

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=157095116
parent f16967cd
......@@ -213,10 +213,10 @@ import java.util.concurrent.CopyOnWriteArraySet;
maskingPeriodIndex = 0;
} else {
timeline.getWindow(windowIndex, window);
long resolvedPositionMs =
positionMs == C.TIME_UNSET ? window.getDefaultPositionUs() : positionMs;
long resolvedPositionUs =
positionMs == C.TIME_UNSET ? window.getDefaultPositionUs() : C.msToUs(positionMs);
int periodIndex = window.firstPeriodIndex;
long periodPositionUs = window.getPositionInFirstPeriodUs() + C.msToUs(resolvedPositionMs);
long periodPositionUs = window.getPositionInFirstPeriodUs() + resolvedPositionUs;
long periodDurationUs = timeline.getPeriod(periodIndex, period).getDurationUs();
while (periodDurationUs != C.TIME_UNSET && periodPositionUs >= periodDurationUs
&& periodIndex < window.lastPeriodIndex) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment