Clarify the replaceOutputBuffer parameter because count is unclear.
PiperOrigin-RevId: 474279220
This commit is contained in:
parent
60ea64734b
commit
bca9c9b280
@ -103,13 +103,13 @@ public abstract class BaseAudioProcessor implements AudioProcessor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Replaces the current output buffer with a buffer of at least {@code count} bytes and returns
|
* Replaces the current output buffer with a buffer of at least {@code size} bytes and returns it.
|
||||||
* it. Callers should write to the returned buffer then {@link ByteBuffer#flip()} it so it can be
|
* Callers should write to the returned buffer then {@link ByteBuffer#flip()} it so it can be read
|
||||||
* read via {@link #getOutput()}.
|
* via {@link #getOutput()}.
|
||||||
*/
|
*/
|
||||||
protected final ByteBuffer replaceOutputBuffer(int count) {
|
protected final ByteBuffer replaceOutputBuffer(int size) {
|
||||||
if (buffer.capacity() < count) {
|
if (buffer.capacity() < size) {
|
||||||
buffer = ByteBuffer.allocateDirect(count).order(ByteOrder.nativeOrder());
|
buffer = ByteBuffer.allocateDirect(size).order(ByteOrder.nativeOrder());
|
||||||
} else {
|
} else {
|
||||||
buffer.clear();
|
buffer.clear();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user