summaryrefslogtreecommitdiffstats
path: root/mpvcore/m_config.h
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-10-24 22:20:16 +0200
committerwm4 <wm4@nowhere>2013-10-24 22:50:13 +0200
commit60aea74f4483661e34b12571add07f8e5e136660 (patch)
treec1b0c94cbb926785cec0e56d7bd50fa18e9f4457 /mpvcore/m_config.h
parentf6bceacaff0d2e1a1265d29372fcf7b34c57446c (diff)
downloadmpv-60aea74f4483661e34b12571add07f8e5e136660.tar.bz2
mpv-60aea74f4483661e34b12571add07f8e5e136660.tar.xz
m_config: refactor option defaults handling
Keep track of the default values directly, instead of creating a new instance of the option struct just to get the defaults. Also get rid of the special handling of m_obj_desc.init_options. Instead, handle it purely by the option parser. Originally, I wanted to handle --vo=opengl-hq and --vo=direct3d_shaders with this (by making them aliases to the real VOs with a different preset), but since --vo =opengl-hq=help prints the wrong values (as consequence of the simplification), I'm not doing that, and instead use something different.
Diffstat (limited to 'mpvcore/m_config.h')
-rw-r--r--mpvcore/m_config.h5
1 files changed, 2 insertions, 3 deletions
diff --git a/mpvcore/m_config.h b/mpvcore/m_config.h
index f16d1ea7fe..c5d1d35e49 100644
--- a/mpvcore/m_config.h
+++ b/mpvcore/m_config.h
@@ -43,6 +43,7 @@ struct m_config_option {
const struct m_option *opt;
// Raw value of the option.
void *data;
+ const void *default_data;
};
// Config object
@@ -65,7 +66,6 @@ typedef struct m_config {
const void *optstruct_defaults;
size_t optstruct_size;
const struct m_option *options; // top-level options
- const char *suboptinit;
void *optstruct; // struct mpopts or other
} m_config_t;
@@ -81,8 +81,7 @@ typedef struct m_config {
// Note that the m_config object will keep pointers to defaults and options.
struct m_config *m_config_new(void *talloc_parent, size_t size,
const void *defaults,
- const struct m_option *options,
- const char *suboptinit);
+ const struct m_option *options);
struct m_config *m_config_from_obj_desc(void *talloc_parent,
struct m_obj_desc *desc);