Commit 1a6f36d4 by tonihei Committed by Oliver Woodman

Fix reading position at stream transition.

PiperOrigin-RevId: 374836046
parent 8eb990e4
......@@ -113,7 +113,9 @@ public abstract class BaseRenderer implements Renderer, RendererCapabilities {
throws ExoPlaybackException {
Assertions.checkState(!streamIsFinal);
this.stream = stream;
readingPositionUs = offsetUs;
if (readingPositionUs == C.TIME_END_OF_SOURCE) {
readingPositionUs = startPositionUs;
}
streamFormats = formats;
streamOffsetUs = offsetUs;
onStreamChanged(formats, startPositionUs, offsetUs);
......
......@@ -339,9 +339,8 @@ public interface Renderer extends PlayerMessage.Target {
boolean hasReadStreamToEnd();
/**
* Returns the renderer time up to which the renderer has read samples from the current {@link
* SampleStream}, in microseconds, or {@link C#TIME_END_OF_SOURCE} if the renderer has read the
* current {@link SampleStream} to the end.
* Returns the renderer time up to which the renderer has read samples, in microseconds, or {@link
* C#TIME_END_OF_SOURCE} if the renderer has read the current {@link SampleStream} to the end.
*
* <p>This method may be called when the renderer is in the following states: {@link
* #STATE_ENABLED}, {@link #STATE_STARTED}.
......
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