Rename timeUs to currentTimeUs

This is a non-functional refactor.

PiperOrigin-RevId: 684408479
This commit is contained in:
ivanbuper 2024-10-10 05:33:01 -07:00 committed by Copybara-Service
parent cbc0ee369f
commit 3818e103e6

View File

@ -115,23 +115,23 @@ public final class SpeedChangingAudioProcessor extends BaseAudioProcessor {
@Override @Override
public void queueInput(ByteBuffer inputBuffer) { public void queueInput(ByteBuffer inputBuffer) {
long timeUs = long currentTimeUs =
Util.scaleLargeTimestamp( Util.scaleLargeTimestamp(
/* timestamp= */ bytesRead, /* timestamp= */ bytesRead,
/* multiplier= */ C.MICROS_PER_SECOND, /* multiplier= */ C.MICROS_PER_SECOND,
/* divisor= */ (long) inputAudioFormat.sampleRate * inputAudioFormat.bytesPerFrame); /* divisor= */ (long) inputAudioFormat.sampleRate * inputAudioFormat.bytesPerFrame);
float newSpeed = speedProvider.getSpeed(timeUs); float newSpeed = speedProvider.getSpeed(currentTimeUs);
updateSpeed(newSpeed, timeUs); updateSpeed(newSpeed, currentTimeUs);
int inputBufferLimit = inputBuffer.limit(); int inputBufferLimit = inputBuffer.limit();
long nextSpeedChangeTimeUs = speedProvider.getNextSpeedChangeTimeUs(timeUs); long nextSpeedChangeTimeUs = speedProvider.getNextSpeedChangeTimeUs(currentTimeUs);
int bytesToNextSpeedChange; int bytesToNextSpeedChange;
if (nextSpeedChangeTimeUs != C.TIME_UNSET) { if (nextSpeedChangeTimeUs != C.TIME_UNSET) {
bytesToNextSpeedChange = bytesToNextSpeedChange =
(int) (int)
Util.scaleLargeValue( Util.scaleLargeValue(
/* timestamp= */ nextSpeedChangeTimeUs - timeUs, /* timestamp */ nextSpeedChangeTimeUs - currentTimeUs,
/* multiplier= */ (long) inputAudioFormat.sampleRate /* multiplier= */ (long) inputAudioFormat.sampleRate
* inputAudioFormat.bytesPerFrame, * inputAudioFormat.bytesPerFrame,
/* divisor= */ C.MICROS_PER_SECOND, /* divisor= */ C.MICROS_PER_SECOND,