diff mbox series

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

Message ID 20200830145045.4437-5-andreas.rheinhardt@gmail.com
State Accepted
Commit 901251d59bd287954f334bc153a0d71853debb92
Headers show
Series [FFmpeg-devel,1/5] avdevice/lavfi: Use av_packet_move_ref() for packet ownership transfer | expand

Checks

Context Check Description
andriy/default pending
andriy/make success Make finished
andriy/make_fate success Make fate finished

Commit Message

Andreas Rheinhardt Aug. 30, 2020, 2:50 p.m. UTC
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@gmail.com>
---
 libavdevice/lavfi.c | 1 -
 1 file changed, 1 deletion(-)

Comments

Paul B Mahol Aug. 30, 2020, 3:29 p.m. UTC | #1
On 8/30/20, Andreas Rheinhardt <andreas.rheinhardt@gmail.com> wrote:
> 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@gmail.com>
> ---
>  libavdevice/lavfi.c | 1 -
>  1 file changed, 1 deletion(-)
>

LGTM

> 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
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
diff mbox series

Patch

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;
 }