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

Andreas Rheinhardt git at videolan.org
Tue Sep 1 10:50:18 EEST 2020


ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinhardt at gmail.com> | Sun Aug 30 07:32:48 2020 +0200| [901251d59bd287954f334bc153a0d71853debb92] | committer: Andreas Rheinhardt

avdevice/lavfi: Don't set pkt->size to the value it already has

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.

Reviewed-by: Paul B Mahol <onemda at gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=901251d59bd287954f334bc153a0d71853debb92
---

 libavdevice/lavfi.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/libavdevice/lavfi.c b/libavdevice/lavfi.c
index 5e814eada8..72ec1bb9b7 100644
--- a/libavdevice/lavfi.c
+++ b/libavdevice/lavfi.c
@@ -474,7 +474,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;
 }



More information about the ffmpeg-cvslog mailing list