You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-10 06:10:52 +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:
@@ -263,18 +263,17 @@ static int encode_simple_internal(AVCodecContext *avctx, AVPacket *avpkt)
|
|||||||
av_assert0(codec->cb_type == FF_CODEC_CB_TYPE_ENCODE);
|
av_assert0(codec->cb_type == FF_CODEC_CB_TYPE_ENCODE);
|
||||||
|
|
||||||
if (CONFIG_FRAME_THREAD_ENCODER && avci->frame_thread_encoder)
|
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);
|
ret = ff_thread_video_encode_frame(avctx, avpkt, frame, &got_packet);
|
||||||
else {
|
else {
|
||||||
ret = ff_encode_encode_cb(avctx, avpkt, frame, &got_packet);
|
ret = ff_encode_encode_cb(avctx, avpkt, frame, &got_packet);
|
||||||
|
if (frame)
|
||||||
|
av_frame_unref(frame);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (avci->draining && !got_packet)
|
if (avci->draining && !got_packet)
|
||||||
avci->draining_done = 1;
|
avci->draining_done = 1;
|
||||||
|
|
||||||
if (frame)
|
|
||||||
av_frame_unref(frame);
|
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user