From cf01646c397e025307fd8568f9867b23c7769c32 Mon Sep 17 00:00:00 2001 From: Niklas Haas Date: Mon, 7 Aug 2023 18:50:04 +0200 Subject: vo_gpu_next: add ability to use named hook params Closes: https://github.com/mpv-player/mpv/issues/12093 --- video/out/vo_gpu_next.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'video/out/vo_gpu_next.c') 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:; } } -- cgit v1.2.3