1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-21 10:55:51 +02:00

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.
This commit is contained in:
Anton Khirnov 2021-12-13 11:43:16 +01:00
parent 67aceaf4ad
commit b780b6db64

View File

@ -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;
}