From a1154b74a4a3635e4106aba9b1c4c0efdd35e07c Mon Sep 17 00:00:00 2001 From: Lynne Date: Sun, 23 Nov 2025 19:49:01 +0100 Subject: [PATCH] ffv1dec: call ff_get_format if the EC coding changes Decoders need to track all state that hwaccels may be intersted in, and trigger a reconfiguration if it changes. --- libavcodec/ffv1.h | 1 + libavcodec/ffv1dec.c | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/libavcodec/ffv1.h b/libavcodec/ffv1.h index adf76b0644..8a48e8e682 100644 --- a/libavcodec/ffv1.h +++ b/libavcodec/ffv1.h @@ -140,6 +140,7 @@ typedef struct FFV1Context { enum AVPixelFormat pix_fmt; enum AVPixelFormat configured_pix_fmt; int configured_width, configured_height; + int configured_ac; const AVFrame *cur_enc_frame; int plane_count; diff --git a/libavcodec/ffv1dec.c b/libavcodec/ffv1dec.c index a70cd74af4..630a60595d 100644 --- a/libavcodec/ffv1dec.c +++ b/libavcodec/ffv1dec.c @@ -509,13 +509,15 @@ static int read_header(FFV1Context *f, RangeCoder *c) if (f->configured_pix_fmt != f->pix_fmt || f->configured_width != f->avctx->width || - f->configured_height != f->avctx->height) { + f->configured_height != f->avctx->height || + f->configured_ac != f->ac) { f->avctx->pix_fmt = get_pixel_format(f); if (f->avctx->pix_fmt < 0) return AVERROR(EINVAL); f->configured_pix_fmt = f->pix_fmt; f->configured_width = f->avctx->width; f->configured_height = f->avctx->height; + f->configured_ac = f->ac; } ff_dlog(f->avctx, "%d %d %d\n", @@ -921,6 +923,7 @@ static int update_thread_context(AVCodecContext *dst, const AVCodecContext *src) fdst->colorspace = fsrc->colorspace; fdst->pix_fmt = fsrc->pix_fmt; fdst->configured_pix_fmt = fsrc->configured_pix_fmt; + fdst->configured_ac = fsrc->configured_ac; fdst->ec = fsrc->ec; fdst->intra = fsrc->intra;