Commit 3e0ad6d8 by samrobinson Committed by Marc Baechinger

Clarify the replaceOutputBuffer parameter because count is unclear.

PiperOrigin-RevId: 474279220
parent 7c435621
......@@ -101,13 +101,13 @@ public abstract class BaseAudioProcessor implements AudioProcessor {
}
/**
* Replaces the current output buffer with a buffer of at least {@code count} bytes and returns
* it. Callers should write to the returned buffer then {@link ByteBuffer#flip()} it so it can be
* read via {@link #getOutput()}.
* Replaces the current output buffer with a buffer of at least {@code size} bytes and returns it.
* Callers should write to the returned buffer then {@link ByteBuffer#flip()} it so it can be read
* via {@link #getOutput()}.
*/
protected final ByteBuffer replaceOutputBuffer(int count) {
if (buffer.capacity() < count) {
buffer = ByteBuffer.allocateDirect(count).order(ByteOrder.nativeOrder());
protected final ByteBuffer replaceOutputBuffer(int size) {
if (buffer.capacity() < size) {
buffer = ByteBuffer.allocateDirect(size).order(ByteOrder.nativeOrder());
} else {
buffer.clear();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment