| Index: media/filters/decrypting_audio_decoder.cc
|
| diff --git a/media/filters/decrypting_audio_decoder.cc b/media/filters/decrypting_audio_decoder.cc
|
| index 6ae354c47b3cd9b999a61c329a3169451e7943e0..7649469035bc82dfc12698f6e5dae28dfb8547d5 100644
|
| --- a/media/filters/decrypting_audio_decoder.cc
|
| +++ b/media/filters/decrypting_audio_decoder.cc
|
| @@ -63,23 +63,20 @@ void DecryptingAudioDecoder::Initialize(const AudioDecoderConfig& config,
|
| init_cb_ = BindToCurrentLoop(init_cb);
|
| output_cb_ = BindToCurrentLoop(output_cb);
|
|
|
| - // TODO(xhwang): We should be able to DCHECK config.IsValidConfig() and
|
| - // config.is_encrypted().
|
| + // TODO(xhwang): We should be able to DCHECK config.IsValidConfig().
|
| if (!config.IsValidConfig()) {
|
| DLOG(ERROR) << "Invalid audio stream config.";
|
| base::ResetAndReturn(&init_cb_).Run(false);
|
| return;
|
| }
|
|
|
| - // DecryptingAudioDecoder only accepts potentially encrypted stream.
|
| - if (!config.is_encrypted()) {
|
| - base::ResetAndReturn(&init_cb_).Run(false);
|
| - return;
|
| - }
|
| -
|
| config_ = config;
|
|
|
| if (state_ == kUninitialized) {
|
| + // DecoderSelector only chooses |this| when the stream is encrypted.
|
| + // TODO(xhwang): We may also select this decoder for clear stream if a CDM
|
| + // is attached. Then we need to update this. See http://crbug.com/597443
|
| + DCHECK(config.is_encrypted());
|
| DCHECK(cdm_context);
|
| if (!cdm_context->GetDecryptor()) {
|
| MEDIA_LOG(DEBUG, media_log_) << GetDisplayName() << ": no decryptor";
|
| @@ -89,7 +86,8 @@ void DecryptingAudioDecoder::Initialize(const AudioDecoderConfig& config,
|
|
|
| decryptor_ = cdm_context->GetDecryptor();
|
| } else {
|
| - // Reinitialization (i.e. upon a config change)
|
| + // Reinitialization (i.e. upon a config change). The new config can be
|
| + // encrypted or clear.
|
| decryptor_->DeinitializeDecoder(Decryptor::kAudio);
|
| }
|
|
|
|
|