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