[FFmpeg-devel] [PATCH v2 11/18] avfilter/vf_scale: don't ignore incoming chroma location

Niklas Haas ffmpeg at haasn.xyz
Wed Jul 23 16:47:14 EEST 2025


From: Niklas Haas <git at haasn.dev>

This filter was, for some reason, always ignoring the incoming chroma
location in favor of the user-specified value, even when that value was set
to the default (unspecified).

This has been the status quo for quite some time, although commit 04ce01df0bb
made the situation worse by changing it from only happening when scaling is
needed, to always happening even in the no-op case.
---
 libavfilter/vf_scale.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavfilter/vf_scale.c b/libavfilter/vf_scale.c
index aec765b441..54cd0b12b6 100644
--- a/libavfilter/vf_scale.c
+++ b/libavfilter/vf_scale.c
@@ -824,7 +824,8 @@ scale:
         in->color_trc = scale->in_transfer;
     if (scale->in_range != AVCOL_RANGE_UNSPECIFIED)
         in->color_range = scale->in_range;
-    in->chroma_location = scale->in_chroma_loc;
+    if (scale->in_chroma_loc != AVCHROMA_LOC_UNSPECIFIED)
+        in->chroma_location = scale->in_chroma_loc;
 
     flags_orig = in->flags;
     if (scale->interlaced > 0)
-- 
2.50.1



More information about the ffmpeg-devel mailing list