Added fallback to computed AVCDecoderConfigurationRecord if the one

stored in the WVM metadata is invalid.

Change-Id: I9e3c7ba4677f1ac7c19ec4d51f600d28bb427acb
This commit is contained in:
Thomas Inskip 2015-10-14 09:46:14 -07:00
parent cb7173d280
commit a9b6fcedd7
1 changed files with 10 additions and 2 deletions

View File

@ -855,8 +855,16 @@ bool WvmMediaParser::Output(bool output_encrypted_sample) {
if (!ExtractResolutionFromDecoderConfig( if (!ExtractResolutionFromDecoderConfig(
vector_as_array(stream_config), stream_config->size(), vector_as_array(stream_config), stream_config->size(),
&coded_width, &coded_height, &pixel_width, &pixel_height)) { &coded_width, &coded_height, &pixel_width, &pixel_height)) {
LOG(ERROR) << "Failed to parse AVCDecoderConfigurationRecord."; LOG(WARNING) << "Failed to parse AVCDecoderConfigurationRecord. "
return false; "Using computed configuration record instead.";
video_stream_info->set_extra_data(decoder_config_record);
if (!ExtractResolutionFromDecoderConfig(
vector_as_array(&decoder_config_record),
decoder_config_record.size(),
&coded_width, &coded_height, &pixel_width, &pixel_height)) {
LOG(ERROR) << "Failed to parse AVCDecoderConfigurationRecord.";
return false;
}
} }
if (pixel_width != video_stream_info->pixel_width() || if (pixel_width != video_stream_info->pixel_width() ||
pixel_height != video_stream_info->pixel_height()) { pixel_height != video_stream_info->pixel_height()) {