mirror of
https://github.com/androidx/media.git
synced 2025-05-04 22:20:47 +08:00
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
This commit is contained in:
parent
8a9a66c288
commit
412c98e230
@ -210,8 +210,11 @@ public final class AudioProcessingPipeline {
|
||||
if (!isOperational()) {
|
||||
return EMPTY_BUFFER;
|
||||
}
|
||||
ByteBuffer outputBuffer = outputBuffers[getFinalOutputBufferIndex()];
|
||||
if (!outputBuffer.hasRemaining()) {
|
||||
processData(EMPTY_BUFFER);
|
||||
return outputBuffers[getFinalOutputBufferIndex()];
|
||||
}
|
||||
return outputBuffer;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user