mirror of
https://github.com/samsonjs/media.git
synced 2026-04-18 13:25:47 +00:00
Effect: Use element instead of peek, when throwing if null.
If nullness should result in an exception, we should throw as soon as possible,
so that stack traces are easier to follow.
Did a quick scan of media3.effect+transformer and this covers all uses of
peek that immediately throw there.
PiperOrigin-RevId: 603393366
(cherry picked from commit dd7846ee1c)
This commit is contained in:
parent
bfa492bf4f
commit
ecaff24e46
2 changed files with 2 additions and 2 deletions
|
|
@ -158,7 +158,7 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
|
|||
return;
|
||||
}
|
||||
|
||||
BitmapFrameSequenceInfo currentBitmapInfo = checkNotNull(pendingBitmaps.peek());
|
||||
BitmapFrameSequenceInfo currentBitmapInfo = pendingBitmaps.element();
|
||||
FrameInfo currentFrameInfo = currentBitmapInfo.frameInfo;
|
||||
TimestampIterator inStreamOffsetsUs = currentBitmapInfo.inStreamOffsetsUs;
|
||||
checkState(currentBitmapInfo.inStreamOffsetsUs.hasNext());
|
||||
|
|
|
|||
|
|
@ -299,7 +299,7 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
|
|||
|
||||
surfaceTexture.updateTexImage();
|
||||
availableFrameCount--;
|
||||
this.currentFrame = pendingFrames.peek();
|
||||
this.currentFrame = pendingFrames.element();
|
||||
|
||||
FrameInfo currentFrame = checkStateNotNull(this.currentFrame);
|
||||
externalShaderProgramInputCapacity.decrementAndGet();
|
||||
|
|
|
|||
Loading…
Reference in a new issue