Commit 2cc51db5 by kimvde Committed by Oliver Woodman

Refactor SEP prepare to clarify that it is equivalent to EPI prepare.

Before this change:
- SimpleExoPlayer.prepare(mediaSource) ended up calling
  ExoPlayerImpl.setMediaSourcesInternal() with startWindowIndex=0 and
  resetToDefaultPosition=false.
- ExoPlayerImpl.prepare(mediaSource) ended up calling
  ExoPlayerImpl.setMediaSourcesInternal() with
  startWindowIndex=C.INDEX_UNSET and resetToDefaultPosition=true.

This was functionaly equivalent but a bit confusing.

#minor-release

PiperOrigin-RevId: 368818143
parent fff7b807
...@@ -1354,10 +1354,7 @@ public class SimpleExoPlayer extends BasePlayer ...@@ -1354,10 +1354,7 @@ public class SimpleExoPlayer extends BasePlayer
@Override @Override
public void prepare(MediaSource mediaSource, boolean resetPosition, boolean resetState) { public void prepare(MediaSource mediaSource, boolean resetPosition, boolean resetState) {
verifyApplicationThread(); verifyApplicationThread();
setMediaSources( setMediaSources(Collections.singletonList(mediaSource), resetPosition);
Collections.singletonList(mediaSource),
/* startWindowIndex= */ resetPosition ? 0 : C.INDEX_UNSET,
/* startPositionMs= */ C.TIME_UNSET);
prepare(); prepare();
} }
......
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