Index: media/mp4/mp4_stream_parser.cc |
diff --git a/media/mp4/mp4_stream_parser.cc b/media/mp4/mp4_stream_parser.cc |
index 38333fb64761e0741c3f77fa952d988ff983ede6..f7a00da3a7c2b3146db487a4c03f7a73c3807aee 100644 |
--- a/media/mp4/mp4_stream_parser.cc |
+++ b/media/mp4/mp4_stream_parser.cc |
@@ -23,7 +23,8 @@ namespace mp4 { |
// TODO(xhwang): Figure out the init data type appropriately once it's spec'ed. |
static const char kMp4InitDataType[] = "video/mp4"; |
-MP4StreamParser::MP4StreamParser(bool has_sbr) |
+MP4StreamParser::MP4StreamParser(const std::set<int>& audio_object_types, |
+ bool has_sbr) |
: state_(kWaitingForInit), |
moof_head_(0), |
mdat_tail_(0), |
@@ -31,6 +32,7 @@ MP4StreamParser::MP4StreamParser(bool has_sbr) |
has_video_(false), |
audio_track_id_(0), |
video_track_id_(0), |
+ audio_object_types_(audio_object_types), |
has_sbr_(has_sbr) { |
} |
@@ -200,11 +202,20 @@ bool MP4StreamParser::ParseMoov(BoxReader* reader) { |
<< std::hex << entry.format << " in stsd box."; |
return false; |
} |
- // Check if it is MPEG4 AAC defined in ISO 14496 Part 3. |
- if (entry.esds.object_type != kISO_14496_3) { |
+ |
+ int audio_type = entry.esds.object_type; |
+ if (audio_object_types_.find(audio_type) == audio_object_types_.end()) { |
+ MEDIA_LOG(log_cb_) << "audio object type 0x" << std::hex << audio_type |
+ << " does not match what is specified in the" |
+ << " mimetype."; |
+ return false; |
+ } |
+ |
+ // Check if it is MPEG4 AAC defined in ISO 14496 Part 3 or |
+ // supported MPEG2 AAC varients. |
+ if (audio_type != kISO_14496_3 && audio_type != kISO_13818_7_AAC_LC) { |
scherkus (not reviewing)
2013/01/08 23:51:08
worth switch+case-ifying against future changes to
acolwell GONE FROM CHROMIUM
2013/01/16 17:35:09
Unfortunately since audio_type comes directly from
|
MEDIA_LOG(log_cb_) << "Unsupported audio object type 0x" << std::hex |
- << static_cast<int>(entry.esds.object_type) |
- << " in esds."; |
+ << audio_type << " in esds."; |
return false; |
} |