Commit 412c98e2 by samrobinson Committed by Ian Baker

Return output immediately if available from AudioProcessingPipeline.

If there is output data available (outputBuffer.hasRemaining()), then
there is no need to move other data between the underlying processors.
It will not change the buffer being returned by that call to getOutput.

If there is no output data readily available, it's necessary to go to
the AudioProcessors and pass buffers between them, as this may produce
data for output.

PiperOrigin-RevId: 490482653
parent 8a9a66c2
...@@ -210,8 +210,11 @@ public final class AudioProcessingPipeline { ...@@ -210,8 +210,11 @@ public final class AudioProcessingPipeline {
if (!isOperational()) { if (!isOperational()) {
return EMPTY_BUFFER; return EMPTY_BUFFER;
} }
processData(EMPTY_BUFFER); ByteBuffer outputBuffer = outputBuffers[getFinalOutputBufferIndex()];
return outputBuffers[getFinalOutputBufferIndex()]; if (!outputBuffer.hasRemaining()) {
processData(EMPTY_BUFFER);
}
return outputBuffer;
} }
/** /**
......
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