[FFmpeg-devel] [PATCH 4/5] avcodec/decode: Remove unnecessary av_packet_unref()

Andreas Rheinhardt andreas.rheinhardt at outlook.com
Mon Sep 6 23:29:41 EEST 2021


The buffer_pkt is always unreferenced after being used and
is therefore always blank when avcodec_send_packet() is called.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>
---
 libavcodec/decode.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/libavcodec/decode.c b/libavcodec/decode.c
index 643f9d6a30..4def801516 100644
--- a/libavcodec/decode.c
+++ b/libavcodec/decode.c
@@ -587,7 +587,6 @@ int attribute_align_arg avcodec_send_packet(AVCodecContext *avctx, const AVPacke
     if (avpkt && !avpkt->size && avpkt->data)
         return AVERROR(EINVAL);
 
-    av_packet_unref(avci->buffer_pkt);
     if (avpkt && (avpkt->data || avpkt->side_data_elems)) {
         ret = av_packet_ref(avci->buffer_pkt, avpkt);
         if (ret < 0)
-- 
2.30.2



More information about the ffmpeg-devel mailing list