summaryrefslogtreecommitdiffstats
path: root/options/m_config.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-06-13 02:17:31 +0200
committerwm4 <wm4@nowhere>2014-06-13 02:18:26 +0200
commitb7bedbbc367b0e248880d25139056a690ac996a2 (patch)
tree838eb2b7467089e39d8eea4d3a3995e7a5e7f0c0 /options/m_config.c
parenta64e099efcc835e93ea9dafff9bb01829d632fa6 (diff)
downloadmpv-b7bedbbc367b0e248880d25139056a690ac996a2.tar.bz2
mpv-b7bedbbc367b0e248880d25139056a690ac996a2.tar.xz
options: remove some more stuff
The "classic" sub-option stuff is not really needed anymore. The only remaining use can be emulated in a simpler way. But note that this breaks the --screenshot option (instead of the "flat" options like --screenshot-...). This was undocumented and discouraged, so it shouldn't affect anyone.
Diffstat (limited to 'options/m_config.c')
-rw-r--r--options/m_config.c27
1 files changed, 11 insertions, 16 deletions
diff --git a/options/m_config.c b/options/m_config.c
index 585f1f5d81..d1f6faca0d 100644
--- a/options/m_config.c
+++ b/options/m_config.c
@@ -391,25 +391,20 @@ static void m_config_add_option(struct m_config *config,
// Option with children -> add them
if (arg->type->flags & M_OPT_TYPE_HAS_CHILD) {
- if (arg->type->flags & M_OPT_TYPE_USE_SUBSTRUCT) {
- const struct m_sub_options *subopts = arg->priv;
+ const struct m_sub_options *subopts = arg->priv;
- void *new_optstruct = NULL;
- if (co.data) {
- new_optstruct = m_config_alloc_struct(config, subopts);
- substruct_write_ptr(co.data, new_optstruct);
- }
+ void *new_optstruct = NULL;
+ if (co.data) {
+ new_optstruct = m_config_alloc_struct(config, subopts);
+ substruct_write_ptr(co.data, new_optstruct);
+ }
- const void *new_optstruct_def = substruct_read_ptr(co.default_data);
- if (!new_optstruct_def)
- new_optstruct_def = subopts->defaults;
+ const void *new_optstruct_def = substruct_read_ptr(co.default_data);
+ if (!new_optstruct_def)
+ new_optstruct_def = subopts->defaults;
- add_options(config, co.name, new_optstruct,
- new_optstruct_def, subopts->opts);
- } else {
- const struct m_option *sub = arg->priv;
- add_options(config, co.name, optstruct, optstruct_def, sub);
- }
+ add_options(config, co.name, new_optstruct,
+ new_optstruct_def, subopts->opts);
} else {
// Initialize options
if (co.data && co.default_data) {