Commit 8138424d by aquilescanta Committed by Oliver Woodman

Replace usages of SampleQueue.hasNextSample with isReady

PiperOrigin-RevId: 277259448
parent 0f312561
...@@ -523,7 +523,7 @@ import org.checkerframework.checker.nullness.compatqual.NullableType; ...@@ -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 { ...@@ -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 ...@@ -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 { ...@@ -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;
......
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