Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
To: ffmpeg-devel@ffmpeg.org
Subject: Re: [FFmpeg-devel] [PATCH] avcodec/libdav1d: Stop mangling AVPacket.opaque
Date: Sat, 9 Mar 2024 20:37:36 +0100
Message-ID: <DU0P250MB0747950A6F8CA1FF3FDD97D98F262@DU0P250MB0747.EURP250.PROD.OUTLOOK.COM> (raw)
In-Reply-To: <GV1SPRMB00523F21843C5931E0B0B6EE8F202@GV1SPRMB0052.EURP250.PROD.OUTLOOK.COM>

Andreas Rheinhardt:
> Unnecessary since 67e7f0b05eeee37eee1357769038270fda08fe32
> as there are no longer two opaque fields.
> 
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
> ---
>  libavcodec/libdav1d.c | 27 ---------------------------
>  1 file changed, 27 deletions(-)
> 
> diff --git a/libavcodec/libdav1d.c b/libavcodec/libdav1d.c
> index 79478ae893..08fe7a841d 100644
> --- a/libavcodec/libdav1d.c
> +++ b/libavcodec/libdav1d.c
> @@ -296,10 +296,6 @@ static void libdav1d_flush(AVCodecContext *c)
>      dav1d_flush(dav1d->c);
>  }
>  
> -typedef struct OpaqueData {
> -    void    *pkt_orig_opaque;
> -} OpaqueData;
> -
>  static void libdav1d_data_free(const uint8_t *data, void *opaque) {
>      AVBufferRef *buf = opaque;
>  
> @@ -309,7 +305,6 @@ static void libdav1d_data_free(const uint8_t *data, void *opaque) {
>  static void libdav1d_user_data_free(const uint8_t *data, void *opaque) {
>      AVPacket *pkt = opaque;
>      av_assert0(data == opaque);
> -    av_free(pkt->opaque);
>      av_packet_free(&pkt);
>  }
>  
> @@ -332,8 +327,6 @@ static int libdav1d_receive_frame_internal(AVCodecContext *c, Dav1dPicture *p)
>          }
>  
>          if (pkt->size) {
> -            OpaqueData *od = NULL;
> -
>              res = dav1d_data_wrap(data, pkt->data, pkt->size,
>                                    libdav1d_data_free, pkt->buf);
>              if (res < 0) {
> @@ -343,21 +336,9 @@ static int libdav1d_receive_frame_internal(AVCodecContext *c, Dav1dPicture *p)
>  
>              pkt->buf = NULL;
>  
> -            if (pkt->opaque && (c->flags & AV_CODEC_FLAG_COPY_OPAQUE)) {
> -                od = av_mallocz(sizeof(*od));
> -                if (!od) {
> -                    av_packet_free(&pkt);
> -                    dav1d_data_unref(data);
> -                    return AVERROR(ENOMEM);
> -                }
> -                od->pkt_orig_opaque  = pkt->opaque;
> -            }
> -            pkt->opaque = od;
> -
>              res = dav1d_data_wrap_user_data(data, (const uint8_t *)pkt,
>                                              libdav1d_user_data_free, pkt);
>              if (res < 0) {
> -                av_free(pkt->opaque);
>                  av_packet_free(&pkt);
>                  dav1d_data_unref(data);
>                  return res;
> @@ -396,7 +377,6 @@ static int libdav1d_receive_frame(AVCodecContext *c, AVFrame *frame)
>      Libdav1dContext *dav1d = c->priv_data;
>      Dav1dPicture pic = { 0 }, *p = &pic;
>      AVPacket *pkt;
> -    OpaqueData *od = NULL;
>  #if FF_DAV1D_VERSION_AT_LEAST(5,1)
>      enum Dav1dEventFlags event_flags = 0;
>  #endif
> @@ -451,16 +431,9 @@ static int libdav1d_receive_frame(AVCodecContext *c, AVFrame *frame)
>      ff_set_sar(c, frame->sample_aspect_ratio);
>  
>      pkt = (AVPacket *)p->m.user_data.data;
> -    od  = pkt->opaque;
> -
> -    // restore the original user opaque value for
> -    // ff_decode_frame_props_from_pkt()
> -    pkt->opaque = od ? od->pkt_orig_opaque : NULL;
> -    av_freep(&od);
>  
>      // match timestamps and packet size
>      res = ff_decode_frame_props_from_pkt(c, frame, pkt);
> -    pkt->opaque = NULL;
>      if (res < 0)
>          goto fail;
>  

Will apply tomorrow unless there are objections.

- Andreas

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

      reply	other threads:[~2024-03-09 19:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-07 15:40 Andreas Rheinhardt
2024-03-09 19:37 ` Andreas Rheinhardt [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=DU0P250MB0747950A6F8CA1FF3FDD97D98F262@DU0P250MB0747.EURP250.PROD.OUTLOOK.COM \
    --to=andreas.rheinhardt@outlook.com \
    --cc=ffmpeg-devel@ffmpeg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git