Switch argument order passed to scaleLargeTimestamp.

durationUs is almost always going to be a larger number than the sample
rate, so pass as the main value, rather than the multiplier.

PiperOrigin-RevId: 547193927
This commit is contained in:
samrobinson 2023-07-11 16:12:52 +01:00 committed by Rohit Singh
parent fcadecf2b1
commit 4983d4f339

View file

@ -53,8 +53,8 @@ import java.util.concurrent.atomic.AtomicLong;
// overflow-safe multiplication & division.
long outputFrameCount =
Util.scaleLargeTimestamp(
/* timestamp= */ audioFormat.sampleRate,
/* multiplier= */ durationUs,
/* timestamp= */ durationUs,
/* multiplier= */ audioFormat.sampleRate,
/* divisor= */ C.MICROS_PER_SECOND);
remainingBytesToOutput.addAndGet(audioFormat.bytesPerFrame * outputFrameCount);