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 { |