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

Unified Diff: media/filters/ffmpeg_audio_decoder.cc

Issue 2885643002: Have FFmpeg Decoders handle 0 byte buffers instead of FFmpeg (Closed)
Patch Set: FFmpegAudioDecoder Created 3 years, 7 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.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/ffmpeg_audio_decoder.cc
diff --git a/media/filters/ffmpeg_audio_decoder.cc b/media/filters/ffmpeg_audio_decoder.cc
index 146fc9726f17ea90d091f2b75daa36bd6f571148..57b376c262432b7abcfc64ac02514398fb038381 100644
--- a/media/filters/ffmpeg_audio_decoder.cc
+++ b/media/filters/ffmpeg_audio_decoder.cc
@@ -186,6 +186,12 @@ bool FFmpegAudioDecoder::FFmpegDecode(
} else {
packet.data = const_cast<uint8_t*>(buffer->data());
packet.size = buffer->data_size();
+
+ // Since we're not at EOS and there is no data available in the current
+ // buffer, simply return and let the caller provide more data.
+ // crbug.com/663438 has more context on 0-byte buffers.
+ if (!packet.size)
+ return true;
}
// Each audio packet may contain several frames, so we must call the decoder
« no previous file with comments | « no previous file | media/filters/ffmpeg_video_decoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698