Commit c0e633fb by bachinger Committed by Oliver Woodman

use getPeriodByUid when searching for subsequent period of seek timeline

Issue: #6641
PiperOrigin-RevId: 279963739
parent 4b012a9b
...@@ -1433,6 +1433,7 @@ import java.util.concurrent.atomic.AtomicBoolean; ...@@ -1433,6 +1433,7 @@ import java.util.concurrent.atomic.AtomicBoolean;
* @throws IllegalSeekPositionException If the window index of the seek position is outside the * @throws IllegalSeekPositionException If the window index of the seek position is outside the
* bounds of the timeline. * bounds of the timeline.
*/ */
@Nullable
private Pair<Object, Long> resolveSeekPosition( private Pair<Object, Long> resolveSeekPosition(
SeekPosition seekPosition, boolean trySubsequentPeriods) { SeekPosition seekPosition, boolean trySubsequentPeriods) {
Timeline timeline = playbackInfo.timeline; Timeline timeline = playbackInfo.timeline;
...@@ -1467,11 +1468,12 @@ import java.util.concurrent.atomic.AtomicBoolean; ...@@ -1467,11 +1468,12 @@ import java.util.concurrent.atomic.AtomicBoolean;
} }
if (trySubsequentPeriods) { if (trySubsequentPeriods) {
// Try and find a subsequent period from the seek timeline in the internal timeline. // Try and find a subsequent period from the seek timeline in the internal timeline.
@Nullable
Object periodUid = resolveSubsequentPeriod(periodPosition.first, seekTimeline, timeline); Object periodUid = resolveSubsequentPeriod(periodPosition.first, seekTimeline, timeline);
if (periodUid != null) { if (periodUid != null) {
// We found one. Map the SeekPosition onto the corresponding default position. // We found one. Use the default position of the corresponding window.
return getPeriodPosition( return getPeriodPosition(
timeline, timeline.getPeriod(periodIndex, period).windowIndex, C.TIME_UNSET); timeline, timeline.getPeriodByUid(periodUid, period).windowIndex, C.TIME_UNSET);
} }
} }
// We didn't find one. Give up. // We didn't find one. Give up.
......
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