mirror of
https://github.com/androidx/media.git
synced 2025-05-04 22:20:47 +08:00
Fix issue with seeking before timeline available
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=140204054
This commit is contained in:
parent
76c58a34d3
commit
ee9b7be2fa
@ -981,9 +981,9 @@ import java.io.IOException;
|
||||
*/
|
||||
private Pair<Integer, Long> resolveSeekPosition(SeekPosition seekPosition) {
|
||||
Timeline seekTimeline = seekPosition.timeline;
|
||||
if (seekTimeline == null) {
|
||||
// The application performed a blind seek without a timeline (most likely based on knowledge
|
||||
// of what the timeline will be). Use the internal timeline.
|
||||
if (seekTimeline.isEmpty()) {
|
||||
// The application performed a blind seek without a non-empty timeline (most likely based on
|
||||
// knowledge of what the future timeline will be). Use the internal timeline.
|
||||
seekTimeline = timeline;
|
||||
Assertions.checkIndex(seekPosition.windowIndex, 0, timeline.getWindowCount());
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user