Clear buffer's timeUs
when setting end-of-stream in SampleQueue
PiperOrigin-RevId: 541657834
This commit is contained in:
parent
6d648f8bdb
commit
69769c77b3
@ -39,7 +39,11 @@ public abstract class Buffer {
|
|||||||
return getFlag(C.BUFFER_FLAG_FIRST_SAMPLE);
|
return getFlag(C.BUFFER_FLAG_FIRST_SAMPLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Returns whether the {@link C#BUFFER_FLAG_END_OF_STREAM} flag is set. */
|
/**
|
||||||
|
* Returns whether the {@link C#BUFFER_FLAG_END_OF_STREAM} flag is set.
|
||||||
|
*
|
||||||
|
* <p>If this is set, all other attributes of the buffer should be ignored.
|
||||||
|
*/
|
||||||
public final boolean isEndOfStream() {
|
public final boolean isEndOfStream() {
|
||||||
return getFlag(C.BUFFER_FLAG_END_OF_STREAM);
|
return getFlag(C.BUFFER_FLAG_END_OF_STREAM);
|
||||||
}
|
}
|
||||||
|
@ -694,6 +694,7 @@ public class SampleQueue implements TrackOutput {
|
|||||||
if (!hasNextSample()) {
|
if (!hasNextSample()) {
|
||||||
if (loadingFinished || isLastSampleQueued) {
|
if (loadingFinished || isLastSampleQueued) {
|
||||||
buffer.setFlags(C.BUFFER_FLAG_END_OF_STREAM);
|
buffer.setFlags(C.BUFFER_FLAG_END_OF_STREAM);
|
||||||
|
buffer.timeUs = C.TIME_END_OF_SOURCE;
|
||||||
return C.RESULT_BUFFER_READ;
|
return C.RESULT_BUFFER_READ;
|
||||||
} else if (upstreamFormat != null && (formatRequired || upstreamFormat != downstreamFormat)) {
|
} else if (upstreamFormat != null && (formatRequired || upstreamFormat != downstreamFormat)) {
|
||||||
onFormatResult(Assertions.checkNotNull(upstreamFormat), formatHolder);
|
onFormatResult(Assertions.checkNotNull(upstreamFormat), formatHolder);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user