diff --git a/media/base/stream_info.h b/media/base/stream_info.h index d1c5d3797a..770e74d176 100644 --- a/media/base/stream_info.h +++ b/media/base/stream_info.h @@ -52,6 +52,8 @@ class StreamInfo : public base::RefCountedThreadSafe { void set_duration(int duration) { duration_ = duration; } + void set_extra_data(const std::vector& data) { extra_data_ = data; } + protected: friend class base::RefCountedThreadSafe; virtual ~StreamInfo(); diff --git a/media/formats/mp2t/es_parser_h264.cc b/media/formats/mp2t/es_parser_h264.cc index 986e7ac00a..472b9fa197 100644 --- a/media/formats/mp2t/es_parser_h264.cc +++ b/media/formats/mp2t/es_parser_h264.cc @@ -316,13 +316,16 @@ bool EsParserH264::UpdateVideoDecoderConfig(const H264SPS* sps) { } if (last_video_decoder_config_) { - // Verify that the video decoder config has not changed. - if (last_video_decoder_config_->extra_data() == decoder_config_record) { - // Video configuration has not changed. - return true; + if (last_video_decoder_config_->extra_data() != decoder_config_record) { + // Video configuration has changed. Issue warning. + // TODO(tinskip): Check the nature of the configuration change. Only + // minor configuration changes (such as frame ordering) can be handled + // gracefully by decoders without notification. Major changes (such as + // video resolution changes) should be treated as errors. + LOG(WARNING) << "H.264 decoder configuration has changed."; + last_video_decoder_config_->set_extra_data(decoder_config_record); } - NOTIMPLEMENTED() << "Varying video configurations are not supported."; - return false; + return true; } // TODO: a MAP unit can be either 16 or 32 pixels.