Skip to content

Commit

Permalink
Pass correct frame size for passthrough playback
Browse files Browse the repository at this point in the history
When estimating the AudioTrack min buffer size, we must use a PCM
frame of 1 when doing direct playback (passthrough). The code was
passing -1 (C.LENGTH_UNSET).

PiperOrigin-RevId: 489238392
  • Loading branch information
christosts authored and microkatz committed Nov 22, 2022
1 parent d1b470e commit 07d25bf
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -707,7 +707,7 @@ public void configure(Format inputFormat, int specifiedBufferSize, @Nullable int
getAudioTrackMinBufferSize(outputSampleRate, outputChannelConfig, outputEncoding),
outputEncoding,
outputMode,
outputPcmFrameSize,
outputPcmFrameSize != C.LENGTH_UNSET ? outputPcmFrameSize : 1,
outputSampleRate,
enableAudioTrackPlaybackParams ? MAX_PLAYBACK_SPEED : DEFAULT_PLAYBACK_SPEED);

Expand Down

0 comments on commit 07d25bf

Please sign in to comment.