[PR] Reapply "avfilter/avfiltergraph: always retry format negotiation after auto-filters" (PR #23924)

Timo Rothenpieler via ffmpeg-devel <[email protected]> Mon, 27 Jul 2026 13:41:05 -0000
Newsgroups gmane.comp.video.ffmpeg.devel
Message-ID <178515968086.59.9685810647038474375@29965ddac10e>
PR #23924 opened by Timo Rothenpieler (BtbN)
URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/23924
Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/23924.patch

This reverts commit cd9d265344b1d39c7b65eb018acac0478c5d736a.

This broke fate.


>From 41cfb0dc98f35d88f11eac615692cf819e170250 Mon Sep 17 00:00:00 2001
From: Timo Rothenpieler <[email protected]>
Date: Mon, 27 Jul 2026 15:39:12 +0200
Subject: [PATCH] Reapply "avfilter/avfiltergraph: always retry format
 negotiation after auto-filters"

This reverts commit cd9d265344b1d39c7b65eb018acac0478c5d736a.
---
 libavfilter/avfiltergraph.c             |  9 +++++----
 tests/fate/filter-video.mak             |  3 +++
 tests/ref/fate/filter-scale-premultiply | 15 +++++++++++++++
 3 files changed, 23 insertions(+), 4 deletions(-)
 create mode 100644 tests/ref/fate/filter-scale-premultiply

diff --git a/libavfilter/avfiltergraph.c b/libavfilter/avfiltergraph.c
index f1abcc80b4..ad81d91bbc 100644
--- a/libavfilter/avfiltergraph.c
+++ b/libavfilter/avfiltergraph.c
@@ -701,10 +701,11 @@ retry:
                 }
             }
 
-            /* if there is more than one auto filter, we may need another round
-             * to fully settle formats due to possible cross-incompatibilities
-             * between the auto filters themselves */
-            if (num_conv > 1)
+            /* if there is an auto filter, we may need another round to fully
+             * settle formats due to possible cross-incompatibilities between
+             * the auto filters themselves, or between the auto filters and
+             * a different attribute of the filter they are modifying */
+            if (num_conv)
                 goto retry;
         }
     }
diff --git a/tests/fate/filter-video.mak b/tests/fate/filter-video.mak
index e3a3be2753..0eb2e7076c 100644
--- a/tests/fate/filter-video.mak
+++ b/tests/fate/filter-video.mak
@@ -888,6 +888,9 @@ FATE_FILTER-$(call ALLYES, TESTSRC2_FILTER SPLIT_FILTER AVGBLUR_FILTER        \
                            METADATA_FILTER WRAPPED_AVFRAME_ENCODER NULL_MUXER \
                            PIPE_PROTOCOL) += $(FATE_FILTER_REFCMP_METADATA-yes)
 
+FATE_FILTER-$(call FILTERFRAMECRC, TESTSRC SCALE PREMULTIPLY, LAVFI_INDEV) += fate-filter-scale-premultiply
+fate-filter-scale-premultiply: CMD = framecrc -auto_conversion_filters -lavfi "testsrc,format=rgba,setparams=alpha_mode=premultiplied,format=rgba:alpha_modes=straight" -frames:v 10
+
 FATE_SAMPLES_FFPROBE += $(FATE_METADATA_FILTER-yes)
 FATE_SAMPLES_FFMPEG += $(FATE_FILTER_SAMPLES-yes)
 FATE_FFPROBE += $(FATE_FILTER_FFPROBE-yes)
diff --git a/tests/ref/fate/filter-scale-premultiply b/tests/ref/fate/filter-scale-premultiply
new file mode 100644
index 0000000000..13fd79310a
--- /dev/null
+++ b/tests/ref/fate/filter-scale-premultiply
@@ -0,0 +1,15 @@
+#tb 0: 1/25
+#media_type 0: video
+#codec_id 0: rawvideo
+#dimensions 0: 320x240
+#sar 0: 1/1
+0,          0,          0,        1,   307200, 0x73a3b71f
+0,          1,          1,        1,   307200, 0x3f05f047
+0,          2,          2,        1,   307200, 0x50382370
+0,          3,          3,        1,   307200, 0x41a15136
+0,          4,          4,        1,   307200, 0xbc8c78ee
+0,          5,          5,        1,   307200, 0x19839e1b
+0,          6,          6,        1,   307200, 0x8545b93b
+0,          7,          7,        1,   307200, 0x4a4acf07
+0,          8,          8,        1,   307200, 0xefa1dee4
+0,          9,          9,        1,   307200, 0x22dae9ca
-- 
2.52.0

_______________________________________________
ffmpeg-devel mailing list -- [email protected]
To unsubscribe send an email to [email protected]