From f16f425e0a66fd54b5ad4f04df24bae402440641 Mon Sep 17 00:00:00 2001 From: Lynne Date: Tue, 17 Jan 2023 05:07:53 +0100 Subject: [PATCH 29/92] av1dec: add hwaccel_params_buf --- libavcodec/av1dec.c | 2 ++ libavcodec/av1dec.h | 2 ++ 2 files changed, 4 insertions(+) diff --git a/libavcodec/av1dec.c b/libavcodec/av1dec.c index 6fa8b25435..bb38dfb41e 100644 --- a/libavcodec/av1dec.c +++ b/libavcodec/av1dec.c @@ -1177,6 +1177,7 @@ static int av1_decode_frame(AVCodecContext *avctx, AVFrame *frame, switch (unit->type) { case AV1_OBU_SEQUENCE_HEADER: av_buffer_unref(&s->seq_ref); + av_buffer_unref(&s->hwaccel_params_buf); s->seq_ref = av_buffer_ref(unit->content_ref); if (!s->seq_ref) { ret = AVERROR(ENOMEM); @@ -1420,6 +1421,7 @@ static void av1_decode_flush(AVCodecContext *avctx) ff_cbs_flush(s->cbc); + av_buffer_unref(&s->hwaccel_params_buf); if (avctx->hwaccel && avctx->hwaccel->flush) avctx->hwaccel->flush(avctx); } diff --git a/libavcodec/av1dec.h b/libavcodec/av1dec.h index 2be28e7469..7b110ab7db 100644 --- a/libavcodec/av1dec.h +++ b/libavcodec/av1dec.h @@ -66,6 +66,8 @@ typedef struct AV1DecContext { const AVClass *class; AVCodecContext *avctx; + AVBufferRef *hwaccel_params_buf; + enum AVPixelFormat pix_fmt; CodedBitstreamContext *cbc; CodedBitstreamFragment current_obu; -- 2.39.2