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

Paul B Mahol onemda at gmail.com
Mon Aug 31 15:46:23 EEST 2020


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

LGTM if tested.

I think  this is covered by FATE.

> 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
>
> _______________________________________________
> 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