avcodec: set avpkt->size to 0 if encode2() did not output a packet
authorJustin Ruggles <justin.ruggles@gmail.com>
Tue, 7 Feb 2012 19:31:49 +0000 (14:31 -0500)
committerJustin Ruggles <justin.ruggles@gmail.com>
Fri, 10 Feb 2012 02:51:41 +0000 (21:51 -0500)
libavcodec/utils.c

index 9dded6a..de3816b 100644 (file)
@@ -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