Replace usages of SampleQueue.hasNextSample with isReady
PiperOrigin-RevId: 277259448
This commit is contained in:
parent
0f312561e5
commit
8138424d92
@ -523,7 +523,7 @@ import org.checkerframework.checker.nullness.compatqual.NullableType;
|
|||||||
boolean[] trackIsAudioVideoFlags = getPreparedState().trackIsAudioVideoFlags;
|
boolean[] trackIsAudioVideoFlags = getPreparedState().trackIsAudioVideoFlags;
|
||||||
if (!pendingDeferredRetry
|
if (!pendingDeferredRetry
|
||||||
|| !trackIsAudioVideoFlags[track]
|
|| !trackIsAudioVideoFlags[track]
|
||||||
|| sampleQueues[track].hasNextSample()) {
|
|| sampleQueues[track].isReady(/* loadingFinished= */ false)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
pendingResetPositionUs = 0;
|
pendingResetPositionUs = 0;
|
||||||
|
@ -203,11 +203,6 @@ public class SampleQueue implements TrackOutput {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Returns whether a sample is available to be read. */
|
|
||||||
public boolean hasNextSample() {
|
|
||||||
return metadataQueue.hasNextSample();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the absolute index of the first sample.
|
* Returns the absolute index of the first sample.
|
||||||
*/
|
*/
|
||||||
|
@ -740,7 +740,7 @@ public class ChunkSampleStream<T extends ChunkSource> implements SampleStream, S
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isReady() {
|
public boolean isReady() {
|
||||||
return loadingFinished || (!isPendingReset() && sampleQueue.hasNextSample());
|
return !isPendingReset() && sampleQueue.isReady(loadingFinished);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -355,7 +355,7 @@ public final class PlayerEmsgHandler implements Handler.Callback {
|
|||||||
// Internal methods.
|
// Internal methods.
|
||||||
|
|
||||||
private void parseAndDiscardSamples() {
|
private void parseAndDiscardSamples() {
|
||||||
while (sampleQueue.hasNextSample()) {
|
while (sampleQueue.isReady(/* loadingFinished= */ false)) {
|
||||||
MetadataInputBuffer inputBuffer = dequeueSample();
|
MetadataInputBuffer inputBuffer = dequeueSample();
|
||||||
if (inputBuffer == null) {
|
if (inputBuffer == null) {
|
||||||
continue;
|
continue;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user