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

Unified Diff: media/filters/ffmpeg_demuxer_unittest.cc

Issue 151192: Cleanup resources allocated by FFmpeg to avoid memory and threads leaks... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 5 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 | « media/filters/ffmpeg_demuxer.cc ('k') | third_party/ffmpeg/avcodec-52.sigs » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/ffmpeg_demuxer_unittest.cc
===================================================================
--- media/filters/ffmpeg_demuxer_unittest.cc (revision 19853)
+++ media/filters/ffmpeg_demuxer_unittest.cc (working copy)
@@ -115,6 +115,12 @@
// Finish up any remaining tasks.
message_loop_.RunAllPending();
+ // Release the reference to the demuxer.
+ demuxer_ = NULL;
+
+ // Filter host also holds a reference to demuxer, destroy it.
+ filter_host_.reset();
+
// Reset MockFFmpeg.
MockFFmpeg::set(NULL);
}
@@ -125,7 +131,7 @@
.WillOnce(DoAll(SetArgumentPointee<0>(&format_context_), Return(0)));
EXPECT_CALL(*MockFFmpeg::get(), AVFindStreamInfo(&format_context_))
.WillOnce(Return(0));
- EXPECT_CALL(*MockFFmpeg::get(), AVFree(&format_context_));
+ EXPECT_CALL(*MockFFmpeg::get(), AVCloseInputFile(&format_context_));
}
// Initializes both MockFFmpeg and FFmpegDemuxer.
@@ -202,7 +208,7 @@
.WillOnce(DoAll(SetArgumentPointee<0>(&format_context_), Return(0)));
EXPECT_CALL(*MockFFmpeg::get(), AVFindStreamInfo(&format_context_))
.WillOnce(Return(AVERROR_IO));
- EXPECT_CALL(*MockFFmpeg::get(), AVFree(&format_context_));
+ EXPECT_CALL(*MockFFmpeg::get(), AVCloseInputFile(&format_context_));
EXPECT_TRUE(demuxer_->Initialize(data_source_.get()));
message_loop_.RunAllPending();
« no previous file with comments | « media/filters/ffmpeg_demuxer.cc ('k') | third_party/ffmpeg/avcodec-52.sigs » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698