diff options
author | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2024-03-07 16:11:32 +0100 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2024-03-22 16:33:53 +0100 |
commit | c89f6ae6899e0f3ffb4f51da1f1776ab16f5b3a0 (patch) | |
tree | d658404120471a87ec76c6115b8ed99f89af8d13 | |
parent | f04a2ba30230d80201d7021780593625c5ba709e (diff) | |
download | ffmpeg-c89f6ae6899e0f3ffb4f51da1f1776ab16f5b3a0.tar.gz |
avcodec/libdav1d: Stop mangling AVPacket.opaque
Unnecessary since 67e7f0b05eeee37eee1357769038270fda08fe32
as there are no longer two opaque fields.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
-rw-r--r-- | libavcodec/libdav1d.c | 27 |
1 files changed, 0 insertions, 27 deletions
diff --git a/libavcodec/libdav1d.c b/libavcodec/libdav1d.c index 597944d88d..17b0743cf0 100644 --- a/libavcodec/libdav1d.c +++ b/libavcodec/libdav1d.c @@ -305,10 +305,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; @@ -318,7 +314,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); } @@ -341,8 +336,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) { @@ -352,21 +345,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; @@ -405,7 +386,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 @@ -460,16 +440,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; |