summaryrefslogtreecommitdiff
path: root/libavcodec/mpegvideo_enc.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2022-07-16 17:02:38 +0200
committerAnton Khirnov <anton@khirnov.net>2022-08-02 11:06:48 +0200
commit4f7f5ef830100beb3433c76f7ae5e2a10a0c2230 (patch)
treea5bd6134026ddbf99a1cf1f8a1fb2b6200ba878d /libavcodec/mpegvideo_enc.c
parentc6f22940e442ac2d2142ec9dce7ed8474c97aad2 (diff)
lavc/mpegvideo_enc: support AV_CODEC_CAP_ENCODER_RECON_FRAME
Diffstat (limited to 'libavcodec/mpegvideo_enc.c')
-rw-r--r--libavcodec/mpegvideo_enc.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c
index 86a9b55078..e27407c490 100644
--- a/libavcodec/mpegvideo_enc.c
+++ b/libavcodec/mpegvideo_enc.c
@@ -1781,6 +1781,14 @@ vbv_retry:
(avctx->flags&AV_CODEC_FLAG_PSNR) ? MPEGVIDEO_MAX_PLANES : 0,
s->pict_type);
+ if (avctx->flags & AV_CODEC_FLAG_RECON_FRAME) {
+ AVCodecInternal *avci = avctx->internal;
+ av_frame_unref(avci->recon_frame);
+ ret = av_frame_ref(avci->recon_frame, s->current_picture.f);
+ if (ret < 0)
+ return ret;
+ }
+
if (avctx->flags & AV_CODEC_FLAG_PASS1)
assert(put_bits_count(&s->pb) == s->header_bits + s->mv_bits +
s->misc_bits + s->i_tex_bits +