diff options
author | wm4 <wm4@nowhere> | 2014-04-21 23:52:14 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2014-04-22 01:42:57 +0200 |
commit | b430c886aa33813287499df075aad8dadb6bd7b3 (patch) | |
tree | 839acd61a7c937869e98bf28db266d32a559fe0d /options/m_config.h | |
parent | bdfe02158f22da7d078978ee6625701226412a54 (diff) | |
download | mpv-b430c886aa33813287499df075aad8dadb6bd7b3.tar.bz2 mpv-b430c886aa33813287499df075aad8dadb6bd7b3.tar.xz |
client API: make mpv_set_option set options natively
This should fix some issues, such as not being able to set the
"no-video" option with MPV_FORMAT_FLAG.
Note that this changes semantics a bit. Now setting an option strictly
overwrite it, even if the corresponding command line option does not.
For example, if we change --sub to append by default, then setting the
"sub" option via the client API would still never append. (Oddly, this
also applies to --vf-add, which will overwrite the old value when using
the client API.)
I'm doing this because there's no proper separation between the command
line parser and setting an option using the MPV_FORMAT_STRING format.
Maybe the solution to this mess would be adding format aware code (i.e.
m_option_set_node) to every option type, and falling back to strings
only if needed - but this would mean that you couldn't set e.g. an
integer option using MPV_FORMAT_STRING, which doesn't seem to be ideal
either.
In conclusion, the current approach seems to be most robust, but I'm
open to suggestions should someone find that these semantics are a
problem.
Diffstat (limited to 'options/m_config.h')
-rw-r--r-- | options/m_config.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/options/m_config.h b/options/m_config.h index 632ba09e77..57a271f1c4 100644 --- a/options/m_config.h +++ b/options/m_config.h @@ -139,10 +139,10 @@ static inline int m_config_set_option0(struct m_config *config, return m_config_set_option(config, bstr0(name), bstr0(param)); } -// Same as m_config_set_option_ext(), but set as data using mpv_node. +// Similar to m_config_set_option_ext(), but set as data using mpv_node. struct mpv_node; int m_config_set_option_node(struct m_config *config, bstr name, - struct mpv_node *data, int flags); + struct mpv_node *data); int m_config_parse_suboptions(struct m_config *config, char *name, |