Fix reading position at stream transition.
PiperOrigin-RevId: 374836046
This commit is contained in:
parent
8eb990e47a
commit
1a6f36d4a4
@ -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}.
|
||||
|
Loading…
x
Reference in New Issue
Block a user