diff options
author | wm4 <wm4@nowhere> | 2013-10-25 15:31:47 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2013-10-25 18:39:15 +0200 |
commit | 75e1c6f295ff9c0631371b6565c1d20e8f2da8b6 (patch) | |
tree | ae7cbf0114807ebb0fa8ecfd2bd64f9400d860c6 /mpvcore/m_option.c | |
parent | cb3327fe48a35b20900c9ad47ddf4c17486a1e04 (diff) | |
download | mpv-75e1c6f295ff9c0631371b6565c1d20e8f2da8b6.tar.bz2 mpv-75e1c6f295ff9c0631371b6565c1d20e8f2da8b6.tar.xz |
m_config: allow not allocating option struct, and use it
In cases we're just listing options or checking their values (as it
happens with -vo/-vf etc. suboption parsing), we don't need to allocate
abd initialize the actual option struct. All we're interested in is
the list of options.
Diffstat (limited to 'mpvcore/m_option.c')
-rw-r--r-- | mpvcore/m_option.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/mpvcore/m_option.c b/mpvcore/m_option.c index 095e86a2b5..cd88b4cdca 100644 --- a/mpvcore/m_option.c +++ b/mpvcore/m_option.c @@ -2140,7 +2140,7 @@ static int parse_obj_settings(struct bstr opt, struct bstr *pstr, } if (_ret && desc.init_options) { - struct m_config *config = m_config_from_obj_desc(NULL, &desc); + struct m_config *config = m_config_from_obj_desc_noalloc(NULL, &desc); bstr s = bstr0(desc.init_options); m_obj_parse_sub_config(opt, str, &s, config, M_SETOPT_CHECK_ONLY, &plist); @@ -2169,7 +2169,7 @@ static int parse_obj_settings(struct bstr opt, struct bstr *pstr, } else { struct m_config *config = NULL; if (!skip) - config = m_config_from_obj_desc(NULL, &desc); + config = m_config_from_obj_desc_noalloc(NULL, &desc); r = m_obj_parse_sub_config(opt, str, pstr, config, M_SETOPT_CHECK_ONLY, _ret ? &plist : NULL); |