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

Unified Diff: media/filters/decrypting_audio_decoder.cc

Issue 332253002: Fix the flushing process of DecryptingAudioDecoder. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Returns EOS frame after decoder flushed. Created 6 years, 6 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/decrypting_audio_decoder_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/decrypting_audio_decoder.cc
diff --git a/media/filters/decrypting_audio_decoder.cc b/media/filters/decrypting_audio_decoder.cc
index 8a898147e5a2d9fc531db8e5690e6365ce9b4ee4..bd4975302b47d35c3bdb9486691c7b21f01ecdfd 100644
--- a/media/filters/decrypting_audio_decoder.cc
+++ b/media/filters/decrypting_audio_decoder.cc
@@ -297,11 +297,9 @@ void DecryptingAudioDecoder::DeliverFrame(
if (scoped_pending_buffer_to_decode->end_of_stream()) {
state_ = kDecodeFinished;
output_cb_.Run(AudioBuffer::CreateEOSBuffer());
- base::ResetAndReturn(&decode_cb_).Run(kOk);
- return;
+ } else {
+ state_ = kIdle;
}
-
- state_ = kIdle;
base::ResetAndReturn(&decode_cb_).Run(kOk);
return;
}
@@ -310,6 +308,14 @@ void DecryptingAudioDecoder::DeliverFrame(
DCHECK(!frames.empty());
ProcessDecodedFrames(frames);
+ if (scoped_pending_buffer_to_decode->end_of_stream()) {
+ // Set |pending_buffer_to_decode_| back as we need to keep flushing the
+ // decryptor until kNeedMoreData is returned.
+ pending_buffer_to_decode_ = scoped_pending_buffer_to_decode;
+ DecodePendingBuffer();
+ return;
+ }
+
state_ = kIdle;
base::ResetAndReturn(&decode_cb_).Run(kOk);
}
« no previous file with comments | « no previous file | media/filters/decrypting_audio_decoder_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698