From a9bd4535d2eac283824d8598aa17f1f44f83a74a Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 15 Apr 2016 11:31:24 +0200 Subject: client API: improve mpv_set_property() handling of MPV_FORMAT_NODE If a mpv_node wrapped a string, the behavior was different from calling mpv_set_property() with MPV_FORMAT_STRING directly. Change this. The original intention was to be strict about types if MPV_FORMAT_NODE is used. But I think the result was less than ideal, and the same change towards less strict behavior was made to mpv_set_option() ages ago. --- options/m_option.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'options/m_option.h') diff --git a/options/m_option.h b/options/m_option.h index 320a9e5b99..7e6550691a 100644 --- a/options/m_option.h +++ b/options/m_option.h @@ -504,6 +504,10 @@ static inline int m_option_set_node(const m_option_t *opt, void *dst, return M_OPT_UNKNOWN; } +// Call m_option_parse for strings, m_option_set_node otherwise. +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); + // see m_option_type.get static inline int m_option_get_node(const m_option_t *opt, void *ta_parent, struct mpv_node *dst, void *src) -- cgit v1.2.3