summaryrefslogtreecommitdiffstats
path: root/libavcodec/utils.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2012-02-24 13:02:05 +0100
committerAnton Khirnov <anton@khirnov.net>2012-02-25 07:48:36 +0100
commit52953d61ca6b4fb6dd5b8892099e9fb9f795490c (patch)
treed87d193071acb6b46b432dc9b76fdcf8cb34b1ee /libavcodec/utils.c
parent99cff417f381bd489f65d38b300bc0d2f3e78de5 (diff)
downloadffmpeg-streaming-52953d61ca6b4fb6dd5b8892099e9fb9f795490c.zip
ffmpeg-streaming-52953d61ca6b4fb6dd5b8892099e9fb9f795490c.tar.gz
lavc: signal no output when a NULL frame is passed to audio encoder without delay
Diffstat (limited to 'libavcodec/utils.c')
-rw-r--r--libavcodec/utils.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 285be9b..4d07c9c 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -862,6 +862,8 @@ int attribute_align_arg avcodec_encode_audio2(AVCodecContext *avctx,
int user_packet = !!avpkt->data;
int nb_samples;
+ *got_packet_ptr = 0;
+
if (!(avctx->codec->capabilities & CODEC_CAP_DELAY) && !frame) {
av_init_packet(avpkt);
avpkt->size = 0;
@@ -883,7 +885,6 @@ int attribute_align_arg avcodec_encode_audio2(AVCodecContext *avctx,
}
if (avctx->codec->encode2) {
- *got_packet_ptr = 0;
ret = avctx->codec->encode2(avctx, avpkt, frame, got_packet_ptr);
if (!ret && *got_packet_ptr) {
if (!(avctx->codec->capabilities & CODEC_CAP_DELAY)) {
OpenPOWER on IntegriCloud