mirror of https://github.com/mpv-player/mpv
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.
This commit is contained in:
parent
012d317a1e
commit
23262308d6
|
@ -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]);
|
||||
|
|
Loading…
Reference in New Issue