Skip to content

Commit

Permalink
vo_gpu_next: restore initial hook param value
Browse files Browse the repository at this point in the history
If the parameter is removed from the `glsl-shader-opts` list, it should
be restored to initial value.
  • Loading branch information
kasper93 committed Nov 8, 2024
1 parent 188e18d commit 74ff36a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions video/out/vo_gpu_next.c
Original file line number Diff line number Diff line change
Expand Up @@ -2133,6 +2133,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]);
Expand Down

0 comments on commit 74ff36a

Please sign in to comment.