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

Unified Diff: media/filters/decrypting_audio_decoder.cc

Issue 11929015: Tighten up media::DecoderBuffer API contract for end of stream buffers (round 2). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixes Created 7 years, 11 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/base/stream_parser_buffer.cc ('k') | media/filters/decrypting_video_decoder.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 1bb04b3a17aea5abeb8a6d469eb4dbff07aa174c..6fb8cdd80c30c23e39ffc4b8f8700857f0bb543e 100644
--- a/media/filters/decrypting_audio_decoder.cc
+++ b/media/filters/decrypting_audio_decoder.cc
@@ -342,10 +342,15 @@ void DecryptingAudioDecoder::DoDecryptAndDecodeBuffer(
void DecryptingAudioDecoder::DecodePendingBuffer() {
DCHECK(message_loop_->BelongsToCurrentThread());
DCHECK_EQ(state_, kPendingDecode) << state_;
+
+ int buffer_size = 0;
+ if (!pending_buffer_to_decode_->IsEndOfStream()) {
+ buffer_size = pending_buffer_to_decode_->GetDataSize();
+ }
+
decryptor_->DecryptAndDecodeAudio(
pending_buffer_to_decode_,
- base::Bind(&DecryptingAudioDecoder::DeliverFrame, this,
- pending_buffer_to_decode_->GetDataSize()));
+ base::Bind(&DecryptingAudioDecoder::DeliverFrame, this, buffer_size));
}
void DecryptingAudioDecoder::DeliverFrame(
« no previous file with comments | « media/base/stream_parser_buffer.cc ('k') | media/filters/decrypting_video_decoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698