[FFmpeg-devel] [PATCH 5/5] avdevice/lavfi: Don't set pkt->size to the value it already has

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


av_new_packet() already sets the size. And if the packet is not
allocated by av_new_packet() (which seems to be impossible atm), both
pkt->size as well as size are 0, so setting it again is unnecessary in
this scenario, too.

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

diff --git a/libavdevice/lavfi.c b/libavdevice/lavfi.c
index 2b4e9290dc..4f05a1542e 100644
--- a/libavdevice/lavfi.c
+++ b/libavdevice/lavfi.c
@@ -464,7 +464,6 @@ static int lavfi_read_packet(AVFormatContext *avctx, AVPacket *pkt)
     pkt->stream_index = stream_idx;
     pkt->pts = frame->pts;
     pkt->pos = frame->pkt_pos;
-    pkt->size = size;
     av_frame_unref(frame);
     return size;
 }
-- 
2.20.1



More information about the ffmpeg-devel mailing list