From b758cf7343d169afaa79a62b8a47af9ced04be27 Mon Sep 17 00:00:00 2001 From: Justin Ruggles Date: Tue, 7 Feb 2012 14:31:49 -0500 Subject: [PATCH] avcodec: set avpkt->size to 0 if encode2() did not output a packet --- libavcodec/utils.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libavcodec/utils.c b/libavcodec/utils.c index 9dded6ae05..de3816b27f 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -881,6 +881,8 @@ int attribute_align_arg avcodec_encode_audio2(AVCodecContext *avctx, avctx->time_base); } avpkt->dts = avpkt->pts; + } else { + avpkt->size = 0; } } else { /* for compatibility with encoders not supporting encode2(), we need to