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

Unified Diff: media/filters/ffmpeg_demuxer.cc

Issue 2434383003: Handle duplicate media track ids in FFmpegDemuxer (Closed)
Patch Set: Stream ids must be unique only per-stream-type Created 4 years, 2 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 | « no previous file | media/filters/ffmpeg_demuxer_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/ffmpeg_demuxer.cc
diff --git a/media/filters/ffmpeg_demuxer.cc b/media/filters/ffmpeg_demuxer.cc
index 7bfbf23bf2a64466c57433806fa69eb31393e081..2e296516203378ffdd5809ef496c3570bec4e262 100644
--- a/media/filters/ffmpeg_demuxer.cc
+++ b/media/filters/ffmpeg_demuxer.cc
@@ -1287,6 +1287,17 @@ void FFmpegDemuxer::OnFindStreamInfoDone(const PipelineStatusCB& status_cb,
}
StreamParser::TrackId track_id = stream->id;
+
+ if ((codec_type == AVMEDIA_TYPE_AUDIO &&
+ media_tracks->getAudioConfig(track_id).IsValidConfig()) ||
+ (codec_type == AVMEDIA_TYPE_VIDEO &&
+ media_tracks->getVideoConfig(track_id).IsValidConfig())) {
+ MEDIA_LOG(INFO, media_log_)
+ << GetDisplayName()
+ << ": skipping duplicate media stream id=" << track_id;
+ continue;
+ }
+
std::string track_label = streams_[i]->GetMetadata("handler_name");
std::string track_language = streams_[i]->GetMetadata("language");
« no previous file with comments | « no previous file | media/filters/ffmpeg_demuxer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698