diff options
author | Anton Khirnov <anton@khirnov.net> | 2012-02-24 13:06:23 +0100 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2012-02-25 07:48:46 +0100 |
commit | d55fa6f9cb1d374065229443fbb717f97df2110c (patch) | |
tree | 6ba742b7b6803417858c0b0127e887eff3de4c22 /libavcodec/utils.c | |
parent | 52953d61ca6b4fb6dd5b8892099e9fb9f795490c (diff) | |
download | ffmpeg-d55fa6f9cb1d374065229443fbb717f97df2110c.tar.gz |
lavc: factorize setting got_packet_ptr in avcodec_encode_video2()
Diffstat (limited to 'libavcodec/utils.c')
-rw-r--r-- | libavcodec/utils.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/utils.c b/libavcodec/utils.c index 4d07c9c52e..47cab4118b 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -1093,10 +1093,11 @@ int attribute_align_arg avcodec_encode_video2(AVCodecContext *avctx, int ret; int user_packet = !!avpkt->data; + *got_packet_ptr = 0; + if (!(avctx->codec->capabilities & CODEC_CAP_DELAY) && !frame) { av_init_packet(avpkt); avpkt->size = 0; - *got_packet_ptr = 0; return 0; } @@ -1105,7 +1106,6 @@ int attribute_align_arg avcodec_encode_video2(AVCodecContext *avctx, av_assert0(avctx->codec->encode2); - *got_packet_ptr = 0; ret = avctx->codec->encode2(avctx, avpkt, frame, got_packet_ptr); if (!ret) { if (!*got_packet_ptr) |