[FFmpeg-devel] [PATCH 1/5] avdevice/lavfi: Use av_packet_move_ref() for packet ownership transfer

Andreas Rheinhardt andreas.rheinhardt at gmail.com
Sun Aug 30 17:50:41 EEST 2020


Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at gmail.com>
---
 libavdevice/lavfi.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/libavdevice/lavfi.c b/libavdevice/lavfi.c
index c949ff7e12..2a95cb013c 100644
--- a/libavdevice/lavfi.c
+++ b/libavdevice/lavfi.c
@@ -392,10 +392,7 @@ static int lavfi_read_packet(AVFormatContext *avctx, AVPacket *pkt)
     int size = 0;
 
     if (lavfi->subcc_packet.size) {
-        *pkt = lavfi->subcc_packet;
-        av_init_packet(&lavfi->subcc_packet);
-        lavfi->subcc_packet.size = 0;
-        lavfi->subcc_packet.data = NULL;
+        av_packet_move_ref(pkt, &lavfi->subcc_packet);
         return pkt->size;
     }
 
-- 
2.20.1



More information about the ffmpeg-devel mailing list