vo_gpu_next: add ability to use named hook params

Closes: https://github.com/mpv-player/mpv/issues/12093
This commit is contained in:
Niklas Haas 2023-08-07 18:50:04 +02:00 committed by Niklas Haas
parent 1b10d9dd9c
commit cf01646c39
1 changed files with 14 additions and 1 deletions

View File

@ -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:;
}
}