Skip to content

Commit

Permalink
Fix handling of repeated EOS in SilenceSkippingAudioProcessor.
Browse files Browse the repository at this point in the history
Issue: #712
PiperOrigin-RevId: 589882412
  • Loading branch information
Samrobbo authored and copybara-github committed Dec 11, 2023
1 parent d356d88 commit 90a0cbd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions RELEASENOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@
`ROLE_FLAG_ALTERNATE` to prevent them being automatically selected for
playback because of their higher resolution.
* Audio:
* Fix handling of EOS for `SilenceSkippingAudioProcessor` when called
multiple times ([#712](https://github.com/androidx/media/issues/712)).
* Video:
* Add workaround for a device issue on Galaxy Tab S7 FE, Chromecast with
Google TV, and Lenovo M10 FHD Plus that causes 60fps AVC streams to be
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,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 90a0cbd

Please sign in to comment.