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_config.h | |
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_config.h')
-rw-r--r-- | mpvcore/m_config.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/mpvcore/m_config.h b/mpvcore/m_config.h index c5d1d35e49..3d82d8cd24 100644 --- a/mpvcore/m_config.h +++ b/mpvcore/m_config.h @@ -73,6 +73,7 @@ typedef struct m_config { // Create a new config object. // talloc_parent: talloc parent context for the m_config allocation // size: size of the optstruct (where option values are stored) +// size==0 creates a config object with no option struct allocated // defaults: if not NULL, points to a struct of same type as optstruct, which // contains default values for all options // options: list of options. Each option defines a member of the optstruct @@ -86,6 +87,9 @@ struct m_config *m_config_new(void *talloc_parent, size_t size, struct m_config *m_config_from_obj_desc(void *talloc_parent, struct m_obj_desc *desc); +struct m_config *m_config_from_obj_desc_noalloc(void *talloc_parent, + struct m_obj_desc *desc); + int m_config_set_obj_params(struct m_config *conf, char **args); // Initialize an object (VO/VF/...) in one go, including legacy handling. |