diff options
author | Anton Khirnov <anton@khirnov.net> | 2021-12-13 11:43:16 +0100 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2021-12-17 10:24:34 +0100 |
commit | b780b6db649e693fb1aaebe0da6006a1a5055466 (patch) | |
tree | 5ed37867c8e9c195d163c418f98106c1e6e38fcd | |
parent | 67aceaf4ad641a4d34c3ec70b532efdc60483e3d (diff) | |
download | ffmpeg-b780b6db649e693fb1aaebe0da6006a1a5055466.tar.gz |
lavc/encode: set frame_number for encoders using receive_packet()
It is currently set in encode_simple_internal(), which is only called
for encoders using the "simple" encoding API.
-rw-r--r-- | libavcodec/encode.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/libavcodec/encode.c b/libavcodec/encode.c index 5575cf23db..618be0573d 100644 --- a/libavcodec/encode.c +++ b/libavcodec/encode.c @@ -247,11 +247,8 @@ end: if (ret < 0 || !got_packet) av_packet_unref(avpkt); - if (frame) { - if (!ret) - avctx->frame_number++; + if (frame) av_frame_unref(frame); - } if (got_packet) // Encoders must always return ref-counted buffers. @@ -383,6 +380,8 @@ int attribute_align_arg avcodec_send_frame(AVCodecContext *avctx, const AVFrame return ret; } + avctx->frame_number++; + return 0; } |