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

Paul B Mahol onemda at gmail.com
Sun Aug 30 18:29:03 EEST 2020


On 8/30/20, Andreas Rheinhardt <andreas.rheinhardt at 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 at 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 at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request at ffmpeg.org with subject "unsubscribe".


More information about the ffmpeg-devel mailing list