Skip to content

starboard: Reinitialize decoder on early config change - #13481

Merged
johnedocampo merged 2 commits into
youtube:mainfrom
johnedocampo:adaptive_audio_fix
Oct 20, 2026
Merged

johnedocampo merged 2 commits into
youtube:mainfrom
johnedocampo:adaptive_audio_fix

Conversation

@johnedocampo

@johnedocampo johnedocampo commented Oct 19, 2026 •

Copy link
Copy Markdown
Member

Update AdaptiveAudioDecoder to check if input has been written since
the last reset. If a substantial change in audio stream information
is detected before any samples are processed, the decoder is now
immediately torn down and re-initialized. This avoids unnecessary
flushing and EOS signaling when there is no data to drain.

Unit tests have been added as well to verify behavior.

Bug: 575560627

@github-actions

github-actions Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor
Context State Description
CI / All Pass ✅ PASS All checks passed
CI / android ✅ PASS Passed
CI / evergreen ✅ PASS Passed
CI / linux ✅ PASS Passed
CI / tvos ✅ PASS Passed
@github-actions

Copy link
Copy Markdown
Contributor

🤖 Gemini Suggested Commit Message


starboard: Reinitialize decoder on early config change

Update AdaptiveAudioDecoder to check if input has been written since
the last reset. If a substantial change in audio stream information
is detected before any samples are processed, the decoder is now
immediately torn down and re-initialized. This avoids unnecessary
flushing and EOS signaling when there is no data to drain.

Bug: None

💡 Pro Tips for a Better Commit Message:

  1. Influence the Result: Want to change the output? You can write custom prompts or instructions directly in the Pull Request description. The model uses that text to generate the message.
  2. Re-run the Generator: Post a comment with: /generate-commit-message
@johnedocampo johnedocampo changed the title starboard: Update AudioDecoder to re-initialize Audio Support Oct 19, 2026
@johnedocampo
johnedocampo force-pushed the adaptive_audio_fix branch 2 times, most recently from d021be4 to 7934f8b Compare October 19, 2026 23:55
@johnedocampo

Copy link
Copy Markdown
Member Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates AdaptiveAudioDecoder::Decode to teardown the audio decoder immediately if a configuration change is detected before the first input is written, avoiding waiting for an end-of-stream signal when there is nothing to drain. It also introduces a new test suite AdaptiveAudioDecoderResetTest in adaptive_audio_decoder_test.cc to verify decoder behavior and swapping during resets with both changing and identical configurations. There are no review comments, and I have no feedback to provide.

@johnedocampo
johnedocampo requested a review from a team October 20, 2026 00:25
@johnedocampo
johnedocampo marked this pull request as ready for review October 20, 2026 00:25

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates AdaptiveAudioDecoder::Decode to immediately tear down the audio decoder if a configuration change is detected before any input has been written since the last reset, avoiding unnecessary waiting on an end-of-stream drain. It also introduces comprehensive unit tests in adaptive_audio_decoder_test.cc to verify this behavior under different reset and configuration change scenarios. There are no review comments, and I have no feedback to provide.

@johnedocampo
johnedocampo enabled auto-merge (squash) October 20, 2026 17:40
@johnedocampo
johnedocampo disabled auto-merge October 20, 2026 17:41
@johnedocampo
johnedocampo merged commit 1509e08 into youtube:main Oct 20, 2026
1037 of 1306 checks passed
cobalt-github-releaser-bot pushed a commit that referenced this pull request Oct 20, 2026
…g change

Refer to original PR: #13481

Update AdaptiveAudioDecoder to check if input has been written since
the last reset. If a substantial change in audio stream information
is detected before any samples are processed, the decoder is now
immediately torn down and re-initialized. This avoids unnecessary
flushing and EOS signaling when there is no data to drain.

Unit tests have been added as well to verify behavior.

Bug: 575560627

(cherry picked from commit 1509e08)
cobalt-github-releaser-bot pushed a commit that referenced this pull request Oct 20, 2026
…g change

Refer to original PR: #13481

Update AdaptiveAudioDecoder to check if input has been written since
the last reset. If a substantial change in audio stream information
is detected before any samples are processed, the decoder is now
immediately torn down and re-initialized. This avoids unnecessary
flushing and EOS signaling when there is no data to drain.

Unit tests have been added as well to verify behavior.

Bug: 575560627

(cherry picked from commit 1509e08)
briantting pushed a commit that referenced this pull request Oct 20, 2026
…g change

Refer to original PR: #13481

Update AdaptiveAudioDecoder to check if input has been written since
the last reset. If a substantial change in audio stream information
is detected before any samples are processed, the decoder is now
immediately torn down and re-initialized. This avoids unnecessary
flushing and EOS signaling when there is no data to drain.

Unit tests have been added as well to verify behavior.

Bug: 575560627

(cherry picked from commit 1509e08)
briantting pushed a commit that referenced this pull request Oct 26, 2026
…g change

Refer to original PR: #13481

Update AdaptiveAudioDecoder to check if input has been written since
the last reset. If a substantial change in audio stream information
is detected before any samples are processed, the decoder is now
immediately torn down and re-initialized. This avoids unnecessary
flushing and EOS signaling when there is no data to drain.

Unit tests have been added as well to verify behavior.

Bug: 575560627

(cherry picked from commit 1509e08)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

2 participants