Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1081)

Unified Diff: media/formats/mp4/mp4_stream_parser.cc

Issue 2050043002: Generate and assign media track ids in demuxers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@use-streamparser-trackid
Patch Set: rebase to ToT Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/filters/media_source_state.cc ('k') | media/test/pipeline_integration_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/formats/mp4/mp4_stream_parser.cc
diff --git a/media/formats/mp4/mp4_stream_parser.cc b/media/formats/mp4/mp4_stream_parser.cc
index 1926d1fe9a5526361df6d3f201891b4307418546..3dd4ce3fd4ef7d17b3cf64448f5cc9c5ccc73fd3 100644
--- a/media/formats/mp4/mp4_stream_parser.cc
+++ b/media/formats/mp4/mp4_stream_parser.cc
@@ -318,6 +318,11 @@ bool MP4StreamParser::ParseMoov(BoxReader* reader) {
codec, sample_format, channel_layout, sample_per_second, extra_data,
is_audio_track_encrypted_ ? AesCtrEncryptionScheme() : Unencrypted(),
base::TimeDelta(), 0);
+ if (!audio_config.IsValidConfig()) {
+ MEDIA_LOG(ERROR, media_log_) << "Invalid audio decoder config: "
+ << audio_config.AsHumanReadableString();
+ return false;
+ }
has_audio_ = true;
audio_track_id_ = track->header.track_id;
media_tracks->AddAudioTrack(audio_config, audio_track_id_, "main",
@@ -369,6 +374,11 @@ bool MP4StreamParser::ParseMoov(BoxReader* reader) {
// SPS/PPS are embedded in the video stream
EmptyExtraData(),
is_video_track_encrypted_ ? AesCtrEncryptionScheme() : Unencrypted());
+ if (!video_config.IsValidConfig()) {
+ MEDIA_LOG(ERROR, media_log_) << "Invalid video decoder config: "
+ << video_config.AsHumanReadableString();
+ return false;
+ }
has_video_ = true;
video_track_id_ = track->header.track_id;
media_tracks->AddVideoTrack(video_config, video_track_id_, "main",
« no previous file with comments | « media/filters/media_source_state.cc ('k') | media/test/pipeline_integration_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698