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
This commit is contained in:
parent
42ac0e5492
commit
dd7846ee1c
@ -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…
x
Reference in New Issue
Block a user