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

Unified Diff: media/filters/ffmpeg_demuxer.cc

Issue 2736073002: Set AVDISCARD_ALL flag for disabled streams in FFmpegDemuxer (Closed)
Patch Set: Added test case for the disabled video stream Created 3 years, 9 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 d329492be4808fca7491f6b9fbe49c523f48f805..19a6f250b5d3655872ef051e95f75494f2408f12 100644
--- a/media/filters/ffmpeg_demuxer.cc
+++ b/media/filters/ffmpeg_demuxer.cc
@@ -732,6 +732,7 @@ void FFmpegDemuxerStream::set_enabled(bool enabled, base::TimeDelta timestamp) {
return;
is_enabled_ = enabled;
+ av_stream()->discard = enabled ? AVDISCARD_DEFAULT : AVDISCARD_ALL;
if (is_enabled_) {
waiting_for_keyframe_ = true;
}
@@ -1287,9 +1288,11 @@ void FFmpegDemuxer::OnFindStreamInfoDone(const PipelineStatusCB& status_cb,
} else if (codec_type == AVMEDIA_TYPE_SUBTITLE) {
detected_text_track_count++;
if (codec_id != AV_CODEC_ID_WEBVTT || !text_enabled_) {
+ stream->discard = AVDISCARD_ALL;
continue;
}
} else {
+ stream->discard = AVDISCARD_ALL;
continue;
}
« 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