Index: webkit/media/filter_helpers.cc |
diff --git a/webkit/media/filter_helpers.cc b/webkit/media/filter_helpers.cc |
index 8003e2a61a5d4078f495ad2e257a162daf0311a0..29639f00536b899541b4feaebd715d4acde55e77 100644 |
--- a/webkit/media/filter_helpers.cc |
+++ b/webkit/media/filter_helpers.cc |
@@ -36,25 +36,33 @@ static void AddDefaultDecodersToCollection( |
base::Bind(&media::MessageLoopFactory::GetMessageLoop, |
base::Unretained(message_loop_factory), |
media::MessageLoopFactory::kPipeline)); |
- |
- scoped_refptr<media::DecryptingAudioDecoder> decrypting_audio_decoder = |
- new media::DecryptingAudioDecoder( |
- base::Bind(&media::MessageLoopFactory::GetMessageLoop, |
- base::Unretained(message_loop_factory), |
- media::MessageLoopFactory::kPipeline), |
- base::Bind(&ProxyDecryptor::RequestDecryptorNotification, |
- base::Unretained(proxy_decryptor))); |
- |
filter_collection->GetAudioDecoders()->push_back(ffmpeg_audio_decoder); |
- filter_collection->GetAudioDecoders()->push_back(decrypting_audio_decoder); |
- scoped_refptr<media::DecryptingVideoDecoder> decrypting_video_decoder = |
- new media::DecryptingVideoDecoder( |
- base::Bind(&media::MessageLoopFactory::GetMessageLoop, |
- base::Unretained(message_loop_factory), |
- media::MessageLoopFactory::kPipeline), |
- base::Bind(&ProxyDecryptor::RequestDecryptorNotification, |
- base::Unretained(proxy_decryptor))); |
+ if (proxy_decryptor) { |
+ scoped_refptr<media::DecryptingAudioDecoder> decrypting_audio_decoder = |
+ new media::DecryptingAudioDecoder( |
+ base::Bind(&media::MessageLoopFactory::GetMessageLoop, |
+ base::Unretained(message_loop_factory), |
+ media::MessageLoopFactory::kPipeline), |
+ base::Bind(&ProxyDecryptor::RequestDecryptorNotification, |
+ base::Unretained(proxy_decryptor))); |
+ filter_collection->GetAudioDecoders()->push_back(decrypting_audio_decoder); |
+ |
+ scoped_refptr<media::DecryptingVideoDecoder> decrypting_video_decoder = |
+ new media::DecryptingVideoDecoder( |
+ base::Bind(&media::MessageLoopFactory::GetMessageLoop, |
+ base::Unretained(message_loop_factory), |
+ media::MessageLoopFactory::kPipeline), |
+ base::Bind(&ProxyDecryptor::RequestDecryptorNotification, |
+ base::Unretained(proxy_decryptor))); |
+ // TODO(xhwang): Ideally we should have decrypting video decoder after |
+ // regular video decoder since in the real world most videos are not |
+ // encrypted. For now FFmpegVideoDecoder can also do decryption |
+ // (decrypt-only), and we perfer DecryptingVideoDecoder (decrypt-and-decode) |
+ // to FFmpegVideoDecoder. Fix this order when we move decryption out of |
+ // FFmpegVideoDecoder. |
+ filter_collection->GetVideoDecoders()->push_back(decrypting_video_decoder); |
+ } |
scoped_refptr<media::FFmpegVideoDecoder> ffmpeg_video_decoder = |
new media::FFmpegVideoDecoder( |
@@ -62,14 +70,6 @@ static void AddDefaultDecodersToCollection( |
base::Unretained(message_loop_factory), |
media::MessageLoopFactory::kPipeline), |
proxy_decryptor); |
- |
- // TODO(xhwang): Ideally we should have decrypting video decoder after |
- // regular video decoder since in the real world most videos are not |
- // encrypted. For now FFmpegVideoDecoder can also do decryption |
- // (decrypt-only), and we perfer DecryptingVideoDecoder (decrypt-and-decode) |
- // to FFmpegVideoDecoder. Fix this order when we move decryption out of |
- // FFmpegVideoDecoder. |
- filter_collection->GetVideoDecoders()->push_back(decrypting_video_decoder); |
filter_collection->GetVideoDecoders()->push_back(ffmpeg_video_decoder); |
} |