[FFmpeg-devel] [PATCH] avcodec/v4l2_m2m_dec: Use av_packet_move_ref()

Andriy Gelman andriy.gelman at gmail.com
Tue May 5 08:54:54 EEST 2020


From: Andriy Gelman <andriy.gelman at gmail.com>

Signed-off-by: Andriy Gelman <andriy.gelman at gmail.com>
---
 libavcodec/v4l2_m2m_dec.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/libavcodec/v4l2_m2m_dec.c b/libavcodec/v4l2_m2m_dec.c
index 3e17e0fcac..f1ad1aa2a2 100644
--- a/libavcodec/v4l2_m2m_dec.c
+++ b/libavcodec/v4l2_m2m_dec.c
@@ -142,8 +142,7 @@ static int v4l2_receive_frame(AVCodecContext *avctx, AVFrame *frame)
     int ret;
 
     if (s->buf_pkt.size) {
-        avpkt = s->buf_pkt;
-        memset(&s->buf_pkt, 0, sizeof(AVPacket));
+        av_packet_move_ref(&avpkt, &s->buf_pkt);
     } else {
         ret = ff_decode_get_packet(avctx, &avpkt);
         if (ret < 0 && ret != AVERROR_EOF)
-- 
2.25.1



More information about the ffmpeg-devel mailing list