Skip to content

Commit

Permalink
use getPeriodByUid when searching for subsequent period of seek timeline
Browse files Browse the repository at this point in the history
Issue: #6641
PiperOrigin-RevId: 279963739
  • Loading branch information
marcbaechinger authored and ojw28 committed Nov 17, 2019
1 parent 4b012a9 commit c0e633f
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1433,6 +1433,7 @@ private void handleSourceInfoRefreshEndedPlayback() {
* @throws IllegalSeekPositionException If the window index of the seek position is outside the
* bounds of the timeline.
*/
@Nullable
private Pair<Object, Long> resolveSeekPosition(
SeekPosition seekPosition, boolean trySubsequentPeriods) {
Timeline timeline = playbackInfo.timeline;
Expand Down Expand Up @@ -1467,11 +1468,12 @@ private Pair<Object, Long> resolveSeekPosition(
}
if (trySubsequentPeriods) {
// Try and find a subsequent period from the seek timeline in the internal timeline.
@Nullable
Object periodUid = resolveSubsequentPeriod(periodPosition.first, seekTimeline, timeline);
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(
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.
Expand Down

0 comments on commit c0e633f

Please sign in to comment.