Skip to content

Commit

Permalink
Cherry pick PR #2672: [media] Reset audio decoder via AudioDecoder::R…
Browse files Browse the repository at this point in the history
…eset() (#2685)

Refer to the original PR: #2672

1. When AdaptiveAudioDecoder() resets |audio_decoder_|, use
audio_decoder_->Reset() to reset |audio_decoder_|.
2. The PR (#2501) does not clean
up |resampler_| and |channel_mixer_|, which causes some tests failed on
ps5. This PR cleans up |resampler_| and |channel_mixer_| in
AdaptiveAudioDecoder::Reset() to fix the
SbPlayerGetAudioConfigurationTest.MultipleSeeks test failures.

b/327229953

Co-authored-by: Bo-Rong Chen <borongchen@google.com>
  • Loading branch information
cobalt-github-releaser-bot and borongc committed Apr 3, 2024
1 parent 90b8d0b commit 9a45c37
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,8 @@ void AdaptiveAudioDecoder::Reset() {

if (audio_decoder_) {
audio_decoder_->Reset();
resampler_.reset();
channel_mixer_.reset();
}
CancelPendingJobs();
while (!decoded_audios_.empty()) {
Expand Down

0 comments on commit 9a45c37

Please sign in to comment.