Commit 8a0d1b17ae for ffmpeg
commit 8a0d1b17aeb1f5d58ae3e8883fd6dd423eef3572
Author: Niklas Haas <git@haasn.dev>
Date: Fri Oct 23 15:31:15 2026 +0200
avfilter/vf_libplacebo: fix forcing output color properties to 0
These options default to -1 (auto), but were only applied when positive,
so e.g. colorspace=gbr or range=unspecified were silently ignored.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sponsored-by: nxtedition AB
Signed-off-by: Niklas Haas <git@haasn.dev>
diff --git a/libavfilter/vf_libplacebo.c b/libavfilter/vf_libplacebo.c
index f3bdf756b5..4f7d7f3472 100644
--- a/libavfilter/vf_libplacebo.c
+++ b/libavfilter/vf_libplacebo.c
@@ -1363,20 +1363,20 @@ done:
RET(ff_formats_ref(outfmts, &cfg_out[0]->formats));
- outfmts = s->colorspace > 0 ? ff_make_formats_list_singleton(s->colorspace)
- : ff_all_color_spaces();
+ outfmts = s->colorspace >= 0 ? ff_make_formats_list_singleton(s->colorspace)
+ : ff_all_color_spaces();
RET(ff_formats_ref(outfmts, &cfg_out[0]->color_spaces));
- outfmts = s->color_range > 0 ? ff_make_formats_list_singleton(s->color_range)
- : ff_all_color_ranges();
+ outfmts = s->color_range >= 0 ? ff_make_formats_list_singleton(s->color_range)
+ : ff_all_color_ranges();
RET(ff_formats_ref(outfmts, &cfg_out[0]->color_ranges));
- outfmts = s->alpha_mode > 0 ? ff_make_formats_list_singleton(s->alpha_mode)
+ outfmts = s->alpha_mode >= 0 ? ff_make_formats_list_singleton(s->alpha_mode)
: ff_all_alpha_modes();
RET(ff_formats_ref(outfmts, &cfg_out[0]->alpha_modes));
- outfmts = s->chroma_location > 0 ? ff_make_formats_list_singleton(s->chroma_location)
- : ff_all_chroma_locations();
+ outfmts = s->chroma_location >= 0 ? ff_make_formats_list_singleton(s->chroma_location)
+ : ff_all_chroma_locations();
RET(ff_formats_ref(outfmts, &cfg_out[0]->chroma_locations));
return 0;