summaryrefslogtreecommitdiffstats
path: root/options/m_option.c
diff options
context:
space:
mode:
Diffstat (limited to 'options/m_option.c')
-rw-r--r--options/m_option.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/options/m_option.c b/options/m_option.c
index 1d929269b0..1d8b1d0bf6 100644
--- a/options/m_option.c
+++ b/options/m_option.c
@@ -106,6 +106,21 @@ const m_option_t *m_option_list_find(const m_option_t *list, const char *name)
return m_option_list_findb(list, bstr0(name));
}
+int m_option_set_node_or_string(struct mp_log *log, const m_option_t *opt,
+ const char *name, void *dst, struct mpv_node *src)
+{
+ if (src->format == MPV_FORMAT_STRING) {
+ // The af and vf option unfortunately require this, because the
+ // option name includes the "action".
+ bstr optname = bstr0(name), a, b;
+ if (bstr_split_tok(optname, "/", &a, &b))
+ optname = b;
+ return m_option_parse(log, opt, optname, bstr0(src->u.string), dst);
+ } else {
+ return m_option_set_node(opt, dst, src);
+ }
+}
+
// Default function that just does a memcpy
static void copy_opt(const m_option_t *opt, void *dst, const void *src)