From e9be8b831d0439fbde7f7a7a017ab6dea79988e4 Mon Sep 17 00:00:00 2001 From: Andreas Rheinhardt Date: Mon, 3 Nov 2025 09:10:22 +0100 Subject: [PATCH] avcodec/tests/avcodec: Test that decoders don't set encoder-only fields For decoders, the pixel format is negotiated via the get_format callback (if there is a choice at all), so decoders should not set pix_fmts. Signed-off-by: Andreas Rheinhardt --- libavcodec/tests/avcodec.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libavcodec/tests/avcodec.c b/libavcodec/tests/avcodec.c index d1a28c1935..b45bd9d08c 100644 --- a/libavcodec/tests/avcodec.c +++ b/libavcodec/tests/avcodec.c @@ -185,6 +185,10 @@ FF_ENABLE_DEPRECATION_WARNINGS codec2->caps_internal & FF_CODEC_CAP_SETS_PKT_DTS) ERR("Decoder %s is marked as setting pkt_dts when it doesn't have" "any effect\n"); +FF_DISABLE_DEPRECATION_WARNINGS + if (codec->type == AVMEDIA_TYPE_VIDEO && (codec->pix_fmts || codec->supported_framerates)) + ERR("Decoder %s sets pix_fmts or supported_framerates.\n"); +FF_ENABLE_DEPRECATION_WARNINGS } if (priv_data_size_wrong(codec2)) ERR_EXT("Private context of codec %s is impossibly-sized (size %d).",