From 23262308d65ad51a6df4c9a6480813928e1eec0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kacper=20Michaj=C5=82ow?= Date: Fri, 8 Nov 2024 04:23:28 +0100 Subject: [PATCH] vo_gpu_next: restore initial hook param value If the parameter is removed from the `glsl-shader-opts` list, it should be restored to initial value. --- video/out/vo_gpu_next.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/video/out/vo_gpu_next.c b/video/out/vo_gpu_next.c index 5a8202d689..dce804818b 100644 --- a/video/out/vo_gpu_next.c +++ b/video/out/vo_gpu_next.c @@ -2116,6 +2116,11 @@ static void update_hook_opts(struct priv *p, char **opts, const char *shaderpath if (!mp_splitext(basename, &shadername)) shadername = bstr0(basename); + for (int i = 0; i < hook->num_parameters; i++) { + const struct pl_hook_par *hp = &hook->parameters[i]; + memcpy(hp->data, &hp->initial, sizeof(*hp->data)); + } + for (int n = 0; opts[n * 2]; n++) { struct bstr k = bstr0(opts[n * 2 + 0]); struct bstr v = bstr0(opts[n * 2 + 1]);