From 3b02a199f04e4017f4119128c96de8b394ef7be3 Mon Sep 17 00:00:00 2001 From: arch1t3cht Date: Mon, 2 Jan 2023 02:13:04 +0100 Subject: [PATCH] vapoursynth: Fix default argument for color range Unlike the other arguments for the resize function, "range_in" does not use the same format as in the frame props. A frame prop _Range=1 means limited, while an argument range_in=1 means full range. --- src/video_provider_vs.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/video_provider_vs.cpp b/src/video_provider_vs.cpp index 8e110eb3f..8ecd621bb 100644 --- a/src/video_provider_vs.cpp +++ b/src/video_provider_vs.cpp @@ -101,6 +101,9 @@ void VapoursynthVideoProvider::SetResizeArg(VSMap *args, const VSMap *props, con int result = vs.GetAPI()->mapGetInt(props, prop_name, 0, &err); if (err != 0 || result == unspecified) { result = deflt; + if (!strcmp(arg_name, "range_in")) { + result = result == VSC_RANGE_FULL ? 1 : 0; + } vs.GetAPI()->mapSetInt(args, arg_name, result, maAppend); } }