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

Unified Diff: media/filters/ffmpeg_video_decoder.cc

Issue 10964055: Call Decryptor::Stop() in FFmpegVideoDecoder::Reset(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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 | media/filters/ffmpeg_video_decoder_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/ffmpeg_video_decoder.cc
diff --git a/media/filters/ffmpeg_video_decoder.cc b/media/filters/ffmpeg_video_decoder.cc
index 097bbc52f3b436c0455f5feac53e58865c67d4da..78269aba47da914676d63801a6cedecc59b08b2f 100644
--- a/media/filters/ffmpeg_video_decoder.cc
+++ b/media/filters/ffmpeg_video_decoder.cc
@@ -179,6 +179,9 @@ void FFmpegVideoDecoder::Reset(const base::Closure& closure) {
return;
}
+ if (decryptor_)
+ decryptor_->Stop();
xhwang 2012/09/22 01:00:49 Maybe rename Decryptor::Stop() to something like F
scherkus (not reviewing) 2012/09/23 20:01:16 Agreed as Stop() is implies there's a Start() -- F
xhwang 2012/09/24 17:27:01 Renamed Stop() to CancelDecrypt(). I know CancelDe
scherkus (not reviewing) 2012/09/24 20:22:33 SGTM
+
reset_cb_ = closure;
// Defer the reset if a read is pending.
@@ -246,7 +249,6 @@ void FFmpegVideoDecoder::DoRead(const ReadCB& read_cb) {
ReadFromDemuxerStream();
}
-
void FFmpegVideoDecoder::ReadFromDemuxerStream() {
DCHECK_NE(state_, kUninitialized);
DCHECK_NE(state_, kDecodeFinished);
@@ -327,6 +329,12 @@ void FFmpegVideoDecoder::DoBufferDecrypted(
DCHECK_NE(state_, kDecodeFinished);
DCHECK(!read_cb_.is_null());
+ if (!stop_cb_.is_null()) {
+ base::ResetAndReturn(&read_cb_).Run(kOk, NULL);
+ DoStop();
+ return;
+ }
+
if (!reset_cb_.is_null()) {
base::ResetAndReturn(&read_cb_).Run(kOk, NULL);
DoReset();
« no previous file with comments | « no previous file | media/filters/ffmpeg_video_decoder_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698