mirror of
https://github.com/androidx/media.git
synced 2025-05-05 06:30:24 +08:00
Fix warning about potential integer overflow in DefaultAudioSink
PiperOrigin-RevId: 444221415
This commit is contained in:
parent
928a69d5f1
commit
40c27c43c8
@ -1008,7 +1008,7 @@ public final class DefaultAudioSink implements AudioSink {
|
|||||||
if (configuration.outputMode == OUTPUT_MODE_PCM) {
|
if (configuration.outputMode == OUTPUT_MODE_PCM) {
|
||||||
submittedPcmBytes += buffer.remaining();
|
submittedPcmBytes += buffer.remaining();
|
||||||
} else {
|
} else {
|
||||||
submittedEncodedFrames += framesPerEncodedSample * encodedAccessUnitCount;
|
submittedEncodedFrames += (long) framesPerEncodedSample * encodedAccessUnitCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
inputBuffer = buffer;
|
inputBuffer = buffer;
|
||||||
@ -1203,7 +1203,7 @@ public final class DefaultAudioSink implements AudioSink {
|
|||||||
// When playing non-PCM, the inputBuffer is never processed, thus the last inputBuffer
|
// When playing non-PCM, the inputBuffer is never processed, thus the last inputBuffer
|
||||||
// must be the current input buffer.
|
// must be the current input buffer.
|
||||||
Assertions.checkState(buffer == inputBuffer);
|
Assertions.checkState(buffer == inputBuffer);
|
||||||
writtenEncodedFrames += framesPerEncodedSample * inputBufferAccessUnitCount;
|
writtenEncodedFrames += (long) framesPerEncodedSample * inputBufferAccessUnitCount;
|
||||||
}
|
}
|
||||||
outputBuffer = null;
|
outputBuffer = null;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user