mirror of
https://github.com/androidx/media.git
synced 2025-04-30 06:46:50 +08: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 dd7846ee1cbeb48ddb5495858a71517858df0554)
This commit is contained in:
parent
bfa492bf4f
commit
ecaff24e46
@ -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