Remove unnecessary checkStateNotNull checks

LongArrayQueue.remove() throws a NoSuchElementException if the queue is
empty.

PiperOrigin-RevId: 697531458
This commit is contained in:
kimvde 2024-11-18 01:02:08 -08:00 committed by Copybara-Service
parent cbb8e2f1e6
commit 2568ff73cb

View File

@ -17,7 +17,6 @@ package androidx.media3.exoplayer.video;
import static androidx.media3.common.util.Assertions.checkArgument;
import static androidx.media3.common.util.Assertions.checkNotNull;
import static androidx.media3.common.util.Assertions.checkStateNotNull;
import androidx.annotation.Nullable;
import androidx.media3.common.C;
@ -197,12 +196,12 @@ import androidx.media3.exoplayer.ExoPlaybackException;
}
private void dropFrame() {
checkStateNotNull(presentationTimestampsUs.remove());
presentationTimestampsUs.remove();
frameRenderer.dropFrame();
}
private void renderFrame(boolean shouldRenderImmediately) {
long presentationTimeUs = checkStateNotNull(presentationTimestampsUs.remove());
long presentationTimeUs = presentationTimestampsUs.remove();
boolean videoSizeUpdated = maybeUpdateOutputVideoSize(presentationTimeUs);
if (videoSizeUpdated) {