From 86c708b7df863b30b81ee795803a0704430ed8d2 Mon Sep 17 00:00:00 2001 From: Bo-Rong Chen Date: Wed, 10 Apr 2024 13:35:48 -0700 Subject: [PATCH] [media] Fix failing to reset all status in AdaptiveAudioDecoder (#2875) 1. This PR (https://github.com/youtube/cobalt/pull/2287) returns an empyt DecodedAudio if it is end of stream. However, |first_input_written_| doesn't reset during AdaptiveAudioDecoder::ResetInternal(), causing it failed on AudioDecoderTest reset-related tests. 2. On ps5, |output_format_checked_| doesn't reset cause |resampler_| and |channel_mixer_| are nullptr, causing AudioDecoderTests fails. b/333416579 b/333412348 b/320568573 Test-On-Device: true (cherry picked from commit 32a2037bf586ab29f080dc09790bb029cb38e715) --- .../starboard/player/filter/adaptive_audio_decoder_internal.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/starboard/shared/starboard/player/filter/adaptive_audio_decoder_internal.cc b/starboard/shared/starboard/player/filter/adaptive_audio_decoder_internal.cc index 19b99b8f0c8a..440873581577 100644 --- a/starboard/shared/starboard/player/filter/adaptive_audio_decoder_internal.cc +++ b/starboard/shared/starboard/player/filter/adaptive_audio_decoder_internal.cc @@ -199,6 +199,8 @@ void AdaptiveAudioDecoder::ResetInternal() { flushing_ = false; stream_ended_ = false; first_output_received_ = false; + first_input_written_ = false; + output_format_checked_ = false; } void AdaptiveAudioDecoder::OnDecoderOutput() {