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

Unified Diff: content/renderer/pepper/video_decoder_shim.cc

Issue 395703002: Fold {Audio|Video}Decoder::Stop() into the dtor. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase only Created 6 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 | « no previous file | media/base/audio_decoder.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/pepper/video_decoder_shim.cc
diff --git a/content/renderer/pepper/video_decoder_shim.cc b/content/renderer/pepper/video_decoder_shim.cc
index afd7f57c31b9fe0701fb033e57c67c056eb26ec3..0726e3ac890f306f3a82f581604fdd242341b7cc 100644
--- a/content/renderer/pepper/video_decoder_shim.cc
+++ b/content/renderer/pepper/video_decoder_shim.cc
@@ -135,9 +135,9 @@ void VideoDecoderShim::DecoderImpl::Initialize(
decoder_ = ffmpeg_video_decoder.Pass();
}
max_decodes_at_decoder_ = decoder_->GetMaxDecodeRequests();
- // We can use base::Unretained() safely in decoder callbacks because we call
- // VideoDecoder::Stop() before deletion. Stop() guarantees there will be no
- // outstanding callbacks after it returns.
+ // We can use base::Unretained() safely in decoder callbacks because
+ // |decoder_| is owned by DecoderImpl. During Stop(), the |decoder_| will be
+ // destroyed and all outstanding callbacks will be fired.
decoder_->Initialize(
config,
true /* low_delay */,
@@ -178,7 +178,7 @@ void VideoDecoderShim::DecoderImpl::Stop() {
// again.
while (!pending_decodes_.empty())
pending_decodes_.pop();
- decoder_->Stop();
+ decoder_.reset();
// This instance is deleted once we exit this scope.
}
« no previous file with comments | « no previous file | media/base/audio_decoder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698