From ee9b7be2fa68d15ec505be1fd69740144fd61b46 Mon Sep 17 00:00:00 2001 From: olly Date: Fri, 25 Nov 2016 08:18:15 -0800 Subject: [PATCH] Fix issue with seeking before timeline available ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=140204054 --- .../google/android/exoplayer2/ExoPlayerImplInternal.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/library/src/main/java/com/google/android/exoplayer2/ExoPlayerImplInternal.java b/library/src/main/java/com/google/android/exoplayer2/ExoPlayerImplInternal.java index eb9890c545..0e0c30ffc0 100644 --- a/library/src/main/java/com/google/android/exoplayer2/ExoPlayerImplInternal.java +++ b/library/src/main/java/com/google/android/exoplayer2/ExoPlayerImplInternal.java @@ -981,9 +981,9 @@ import java.io.IOException; */ private Pair 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()); }