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

Unified Diff: media/filters/ffmpeg_audio_decoder.cc

Issue 11993002: Tighten up media::DecoderBuffer API contract for end of stream buffers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase 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
Index: media/filters/ffmpeg_audio_decoder.cc
diff --git a/media/filters/ffmpeg_audio_decoder.cc b/media/filters/ffmpeg_audio_decoder.cc
index 941bd43b70ec50fe0b515c5098d450734855ba6d..941f79c35af47687f4496548b8db2ad8ec721e9b 100644
--- a/media/filters/ffmpeg_audio_decoder.cc
+++ b/media/filters/ffmpeg_audio_decoder.cc
@@ -351,8 +351,13 @@ void FFmpegAudioDecoder::RunDecodeLoop(
bool skip_eos_append) {
AVPacket packet;
av_init_packet(&packet);
- packet.data = const_cast<uint8*>(input->GetData());
- packet.size = input->GetDataSize();
+ if (input->IsEndOfStream()) {
+ packet.data = NULL;
+ packet.size = 0;
+ } else {
+ packet.data = const_cast<uint8*>(input->GetData());
+ packet.size = input->GetDataSize();
+ }
// Each audio packet may contain several frames, so we must call the decoder
// until we've exhausted the packet. Regardless of the packet size we always

Powered by Google App Engine
This is Rietveld 408576698