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;
|
||||
if (!pendingDeferredRetry
|
||||
|| !trackIsAudioVideoFlags[track]
|
||||
|| sampleQueues[track].hasNextSample()) {
|
||||
|| sampleQueues[track].isReady(/* loadingFinished= */ false)) {
|
||||
return;
|
||||
}
|
||||
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.
|
||||
*/
|
||||
|
@ -740,7 +740,7 @@ public class ChunkSampleStream<T extends ChunkSource> implements SampleStream, S
|
||||
|
||||
@Override
|
||||
public boolean isReady() {
|
||||
return loadingFinished || (!isPendingReset() && sampleQueue.hasNextSample());
|
||||
return !isPendingReset() && sampleQueue.isReady(loadingFinished);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -355,7 +355,7 @@ public final class PlayerEmsgHandler implements Handler.Callback {
|
||||
// Internal methods.
|
||||
|
||||
private void parseAndDiscardSamples() {
|
||||
while (sampleQueue.hasNextSample()) {
|
||||
while (sampleQueue.isReady(/* loadingFinished= */ false)) {
|
||||
MetadataInputBuffer inputBuffer = dequeueSample();
|
||||
if (inputBuffer == null) {
|
||||
continue;
|
||||
|
Loading…
x
Reference in New Issue
Block a user