1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-28 20:53:54 +02:00

avcodec/encode: Avoid unreferencing blank AVFrames

ff_thread_video_encode_frame() already returns blank frames.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
Andreas Rheinhardt 2022-08-25 18:42:10 +02:00
parent 1a5cd79f51
commit 25ea90b733

View File

@ -263,18 +263,17 @@ static int encode_simple_internal(AVCodecContext *avctx, AVPacket *avpkt)
av_assert0(codec->cb_type == FF_CODEC_CB_TYPE_ENCODE);
if (CONFIG_FRAME_THREAD_ENCODER && avci->frame_thread_encoder)
/* This might unref frame. */
/* This will unref frame. */
ret = ff_thread_video_encode_frame(avctx, avpkt, frame, &got_packet);
else {
ret = ff_encode_encode_cb(avctx, avpkt, frame, &got_packet);
if (frame)
av_frame_unref(frame);
}
if (avci->draining && !got_packet)
avci->draining_done = 1;
if (frame)
av_frame_unref(frame);
return ret;
}