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

Unified Diff: media/filters/ffmpeg_demuxer.cc

Issue 827013005: Avoid double task trampoline for Pipeline state transitions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix MojoRendererImpl. Created 5 years, 11 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
Index: media/filters/ffmpeg_demuxer.cc
diff --git a/media/filters/ffmpeg_demuxer.cc b/media/filters/ffmpeg_demuxer.cc
index be31709b05017603df7c655e6e06e417eaef997e..b8adeae3f4364f1f7b081fcdba00a80198f1589e 100644
--- a/media/filters/ffmpeg_demuxer.cc
+++ b/media/filters/ffmpeg_demuxer.cc
@@ -693,6 +693,9 @@ void FFmpegDemuxer::Initialize(DemuxerHost* host,
// streams from being detected properly; this value was chosen arbitrarily.
format_context->max_analyze_duration2 = 60 * AV_TIME_BASE;
+ // Always post the callback because |this| could be destroyed upon failure.
+ PipelineStatusCB bound_status_cb = BindToCurrentLoop(status_cb);
+
// Open the AVFormatContext using our glue layer.
CHECK(blocking_thread_.Start());
base::PostTaskAndReplyWithResult(
@@ -701,7 +704,7 @@ void FFmpegDemuxer::Initialize(DemuxerHost* host,
base::Bind(&FFmpegGlue::OpenContext, base::Unretained(glue_.get())),
base::Bind(&FFmpegDemuxer::OnOpenContextDone,
weak_factory_.GetWeakPtr(),
- status_cb));
+ bound_status_cb));
}
base::Time FFmpegDemuxer::GetTimelineOffset() const {

Powered by Google App Engine
This is Rietveld 408576698