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
(cherry picked from commit 90a0cbd)
  • Loading branch information
Samrobbo authored and microkatz committed Jan 9, 2024
1 parent e509db2 commit 89baa96
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 @@ -19,6 +19,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 89baa96

Please sign in to comment.