mirror of
https://github.com/samsonjs/media.git
synced 2026-04-27 15:07:40 +00:00
use getPeriodByUid when searching for subsequent period of seek timeline
Issue: #6641 PiperOrigin-RevId: 279963739
This commit is contained in:
parent
4b012a9b6e
commit
c0e633fbe1
1 changed files with 4 additions and 2 deletions
|
|
@ -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;
|
||||||
}
|
}
|
||||||
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.
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue