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

Unified Diff: media/filters/ffmpeg_demuxer.cc

Issue 544843005: Avoid FFmpeg destroying active resources during demuxer stop. (Closed) Base URL: http://chromium.googlesource.com/chromium/src.git@master
Patch Set: Typo. Created 6 years, 3 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 | no next file » | 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 bca0d59ff4a9900a7eb2b53628d502087569a283..171d70a1c8023153fa576c14965f94f49e34da33 100644
--- a/media/filters/ffmpeg_demuxer.cc
+++ b/media/filters/ffmpeg_demuxer.cc
@@ -557,8 +557,12 @@ FFmpegDemuxer::~FFmpegDemuxer() {}
void FFmpegDemuxer::Stop() {
DCHECK(task_runner_->BelongsToCurrentThread());
- url_protocol_->Abort();
+
+ // The order of Stop() and Abort() is important here. If Abort() is called
+ // first, control may pass into FFmpeg where it can destruct buffers that are
+ // in the process of being fulfilled by the DataSource.
data_source_->Stop();
+ url_protocol_->Abort();
// This will block until all tasks complete. Note that after this returns it's
// possible for reply tasks (e.g., OnReadFrameDone()) to be queued on this
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698