diff options
author | Niklas Haas <git@haasn.dev> | 2023-08-07 18:50:04 +0200 |
---|---|---|
committer | Niklas Haas <github-daiK1o@haasn.dev> | 2023-08-07 19:34:44 +0200 |
commit | cf01646c397e025307fd8568f9867b23c7769c32 (patch) | |
tree | beba7e13eb0b0770d15d52d014092daa27b2d4a4 /video | |
parent | 1b10d9dd9cbc4164ed0ddbba0b64e64e638f1a1f (diff) | |
download | mpv-cf01646c397e025307fd8568f9867b23c7769c32.tar.bz2 mpv-cf01646c397e025307fd8568f9867b23c7769c32.tar.xz |
vo_gpu_next: add ability to use named hook params
Closes: https://github.com/mpv-player/mpv/issues/12093
Diffstat (limited to 'video')
-rw-r--r-- | video/out/vo_gpu_next.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/video/out/vo_gpu_next.c b/video/out/vo_gpu_next.c index bc572be1a5..403620fd63 100644 --- a/video/out/vo_gpu_next.c +++ b/video/out/vo_gpu_next.c @@ -1831,6 +1831,17 @@ static void update_hook_opts(struct priv *p, char **opts, const char *shaderpath .name = hp->name, }; +#if PL_API_VER >= 308 + if (hp->names) { + for (int j = hp->minimum.i; j <= hp->maximum.i; j++) { + if (bstr_equals0(v, hp->names[j])) { + hp->data->i = j; + goto next_hook; + } + } + } +#endif + switch (hp->type) { case PL_VAR_FLOAT: opt.type = &m_option_type_float; @@ -1850,8 +1861,10 @@ static void update_hook_opts(struct priv *p, char **opts, const char *shaderpath } opt.type->parse(p->log, &opt, k, v, hp->data); - break; + goto next_hook; } + + next_hook:; } } |