Commit 42d78b35 by andrewlewis Committed by Oliver Woodman

Fix seeking before a source is set.

Before this change, calling seekTo then setPlayWhenReady would cause the player
throw an error, due to using the sample source provider before it's set.

Transition to the buffering state in seekToInternal only if we have a sample
source provider.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=126804528
parent e02ca775
...@@ -468,7 +468,6 @@ import java.util.ArrayList; ...@@ -468,7 +468,6 @@ import java.util.ArrayList;
return; return;
} }
setState(ExoPlayer.STATE_BUFFERING);
stopRenderers(); stopRenderers();
rebuffering = false; rebuffering = false;
...@@ -483,6 +482,7 @@ import java.util.ArrayList; ...@@ -483,6 +482,7 @@ import java.util.ArrayList;
updatePlaybackPositions(); updatePlaybackPositions();
if (sampleSourceProvider != null) { if (sampleSourceProvider != null) {
setState(ExoPlayer.STATE_BUFFERING);
handler.sendEmptyMessage(MSG_DO_SOME_WORK); handler.sendEmptyMessage(MSG_DO_SOME_WORK);
} }
} finally { } finally {
......
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