Index: media/filters/decoder_stream_traits.cc |
diff --git a/media/filters/decoder_stream_traits.cc b/media/filters/decoder_stream_traits.cc |
index deaedddc372ab73126eaf0f7ba183c2a716358e3..6e30ea6f0b768e5656bf75780fa8f384631cdabe 100644 |
--- a/media/filters/decoder_stream_traits.cc |
+++ b/media/filters/decoder_stream_traits.cc |
@@ -8,6 +8,7 @@ |
#include "media/base/audio_buffer.h" |
#include "media/base/audio_decoder.h" |
#include "media/base/audio_decoder_config.h" |
+#include "media/base/media_client.h" |
#include "media/base/video_decoder.h" |
#include "media/base/video_frame.h" |
@@ -24,8 +25,18 @@ void DecoderStreamTraits<DemuxerStream::AUDIO>::InitializeDecoder( |
const InitCB& init_cb, |
const OutputCB& output_cb) { |
DCHECK(stream->audio_decoder_config().IsValidConfig()); |
- decoder->Initialize(stream->audio_decoder_config(), cdm_context, init_cb, |
- output_cb); |
+ |
+ AudioDecoderConfig config = stream->audio_decoder_config(); |
+ AudioCodec codec = config.codec(); |
+ MediaClient* media_client = GetMediaClient(); |
+ if (media_client && media_client->IsSupportedPassthroughAudio(codec)) { |
+ config.Initialize(kCodecRaw, kSampleFormatRaw, config.channel_layout(), |
+ config.samples_per_second(), config.extra_data(), |
+ config.encryption_scheme(), config.seek_preroll(), |
+ config.codec_delay()); |
+ } |
+ |
+ decoder->Initialize(config, cdm_context, init_cb, output_cb); |
} |
bool DecoderStreamTraits<DemuxerStream::AUDIO>::NeedsBitstreamConversion( |