mirror of
https://github.com/androidx/media.git
synced 2025-05-09 08:30:43 +08:00
Make sure the AudioProcessors do not receive AP.EMPTY_BUFFER
PiperOrigin-RevId: 489174645
This commit is contained in:
parent
f658fe79b1
commit
8a4f72b959
@ -323,6 +323,13 @@ public final class AudioProcessingPipeline {
|
||||
index > 0
|
||||
? outputBuffers[index - 1]
|
||||
: inputBuffer.hasRemaining() ? inputBuffer : EMPTY_BUFFER;
|
||||
if (input == AudioProcessor.EMPTY_BUFFER) {
|
||||
// TODO(internal b/198772621): compare to how it was done in DefaultAudioSink to make sure
|
||||
// this is not unnecessarily complicated.
|
||||
// Queueing AudioProcessor.EMPTY_BUFFER to an AudioProcessor might lead to unexpected
|
||||
// behaviour (see [Internal: b/259393434]).
|
||||
input = EMPTY_BUFFER;
|
||||
}
|
||||
long inputBytes = input.remaining();
|
||||
audioProcessor.queueInput(input);
|
||||
outputBuffers[index] = audioProcessor.getOutput();
|
||||
|
Loading…
x
Reference in New Issue
Block a user