Chromium Code Reviews| Index: media/webm/webm_stream_parser.cc |
| diff --git a/media/webm/webm_stream_parser.cc b/media/webm/webm_stream_parser.cc |
| index db990cd408a7f8033c3cca1d2be623e5576e5d52..601bb205c8cea6719a3cb67c34365dc755479951 100644 |
| --- a/media/webm/webm_stream_parser.cc |
| +++ b/media/webm/webm_stream_parser.cc |
| @@ -346,20 +346,20 @@ int WebMStreamParser::ParseInfoAndTracks(const uint8* data, int size) { |
| } |
| FFmpegConfigHelper config_helper; |
| - |
| if (!config_helper.Parse(data, bytes_parsed)) { |
| DVLOG(1) << "Failed to parse config data."; |
| return -1; |
| } |
| - if (!config_cb_.Run(config_helper.audio_config(), |
| - config_helper.video_config())) { |
| - DVLOG(1) << "New config data isn't allowed."; |
| - return -1; |
| - } |
| + VideoDecoderConfig video_config; |
| + video_config.CopyFrom(config_helper.video_config()); |
| // TODO(xhwang): Support decryption of audio (see http://crbug.com/123421). |
| - if (!tracks_parser.video_encryption_key_id().empty()) { |
| + bool is_video_encrypted = !tracks_parser.video_encryption_key_id().empty(); |
| + if (is_video_encrypted) { |
| + video_config.set_is_encrypted(true); |
|
acolwell GONE FROM CHROMIUM
2012/09/17 17:41:17
Use Initialize() here and CopyFrom() in an else so
xhwang
2012/09/17 19:42:25
Done.
|
| + |
| + // Fire needkey event. |
| std::string key_id = tracks_parser.video_encryption_key_id(); |
| int key_id_size = key_id.size(); |
| CHECK_GT(key_id_size, 0); |
| @@ -369,6 +369,11 @@ int WebMStreamParser::ParseInfoAndTracks(const uint8* data, int size) { |
| need_key_cb_.Run(key_id_array.Pass(), key_id_size); |
| } |
| + if (!config_cb_.Run(config_helper.audio_config(), video_config)) { |
| + DVLOG(1) << "New config data isn't allowed."; |
| + return -1; |
| + } |
| + |
| cluster_parser_.reset(new WebMClusterParser( |
| info_parser.timecode_scale(), |
| tracks_parser.audio_track_num(), |