mirror of
https://github.com/samsonjs/media.git
synced 2026-03-27 09:45:47 +00:00
Make sure the AudioProcessors do not receive AP.EMPTY_BUFFER
PiperOrigin-RevId: 489174645
This commit is contained in:
parent
59badba5fb
commit
289a0e089e
1 changed files with 7 additions and 0 deletions
|
|
@ -321,6 +321,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…
Reference in a new issue