ff_thread_video_encode_frame() already returns blank frames.
Signed-off-by: Andreas Rheinhardt <[email protected]>
---
libavcodec/encode.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/libavcodec/encode.c b/libavcodec/encode.c
index 2c02b24cf2..8c6d81286c 100644
--- a/libavcodec/encode.c
+++ b/libavcodec/encode.c
@@ -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;
}
--
2.34.1
_______________________________________________
ffmpeg-devel mailing list
[email protected]
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
[email protected] with subject "unsubscribe".