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

Unified Diff: media/filters/ffmpeg_video_decoder.cc

Issue 2885643002: Have FFmpeg Decoders handle 0 byte buffers instead of FFmpeg (Closed)
Patch Set: 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_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 094720566e1eaa7cb03ff02a8784fec0c325231d..cadccc45acca5b0818ab4a4612b12a522d84aaae 100644
--- a/media/filters/ffmpeg_video_decoder.cc
+++ b/media/filters/ffmpeg_video_decoder.cc
@@ -349,6 +349,12 @@ bool FFmpegVideoDecoder::FFmpegDecode(
packet.data = const_cast<uint8_t*>(buffer->data());
packet.size = buffer->data_size();
+ // Starting in M60, avcodec_decode_video2() generates an error if
+ // empty buffer provided. If that is the case signal that more data
xhwang 2017/05/15 23:35:17 "If that is the case" seems to be confusing since
jrummell 2017/05/16 21:54:03 Done.
+ // is required to produce more frames.
xhwang 2017/05/15 23:35:17 Could you please refer to crbug.com/663438 for con
jrummell 2017/05/16 21:54:03 Done.
+ if (!packet.size)
+ return true;
+
// Let FFmpeg handle presentation timestamp reordering.
codec_context_->reordered_opaque = buffer->timestamp().InMicroseconds();
}
« 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