Fix resolveSubsequentPeriod in EPII.

getNextPeriod might return C.INDEX_UNSET.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=159676949
This commit is contained in:
tonihei 2017-06-21 04:00:02 -07:00 committed by Oliver Woodman
parent ed060a8f33
commit 9154d54df9

View file

@ -1083,6 +1083,10 @@ import java.io.IOException;
int maxIterations = oldTimeline.getPeriodCount();
for (int i = 0; i < maxIterations && newPeriodIndex == C.INDEX_UNSET; i++) {
oldPeriodIndex = oldTimeline.getNextPeriodIndex(oldPeriodIndex, period, window, repeatMode);
if (oldPeriodIndex == C.INDEX_UNSET) {
// We've reached the end of the old timeline.
break;
}
newPeriodIndex = newTimeline.getIndexOfPeriod(
oldTimeline.getPeriod(oldPeriodIndex, period, true).uid);
}