Skip to content

Commit

Permalink
Fix handling of repeated EOS in SilenceSkippingAudioProcessor.
Browse files Browse the repository at this point in the history
Issue: androidx/media#712
PiperOrigin-RevId: 589882412
  • Loading branch information
Samrobbo authored and Copybara-Service committed Dec 11, 2023
1 parent edbca99 commit 1f740c5
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,11 @@ public void queueInput(ByteBuffer inputBuffer) {
@Override
protected void onQueueEndOfStream() {
if (maybeSilenceBufferSize > 0) {
// We haven't received enough silence to transition to the silent state, so output the buffer.
// We haven't received enough silence to transition to the silent state, so output the buffer
// and switch back to the noisy state.
output(maybeSilenceBuffer, maybeSilenceBufferSize);
maybeSilenceBufferSize = 0;
state = STATE_NOISY;
}
if (!hasOutputNoise) {
skippedFrames += paddingSize / bytesPerFrame;
Expand Down

0 comments on commit 1f740c5

Please sign in to comment.