From 9df2260506f825a05ecd500496260292ef2481aa Mon Sep 17 00:00:00 2001 From: wm4 Date: Wed, 10 Apr 2013 21:06:00 +0200 Subject: core: add --reset-on-next-file option This option can be used to selectively reset settings when playing the next file in the playlist (i.e. restore mplayer and mplayer2 behavior). Might remove this option again should it turn out that nobody uses it. --- core/m_config.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'core/m_config.c') diff --git a/core/m_config.c b/core/m_config.c index b6c15d3d9a..65d60bdab9 100644 --- a/core/m_config.c +++ b/core/m_config.c @@ -258,6 +258,22 @@ void m_config_leave_file_local(struct m_config *config) } } +void m_config_mark_file_local(struct m_config *config, const char *opt) +{ + struct m_config_option *co = m_config_get_co(config, bstr0(opt)); + if (co) { + ensure_backup(config, co); + } else { + mp_tmsg(MSGT_CFGPARSER, MSGL_ERR, "Option %s not found.\n", opt); + } +} + +void m_config_mark_all_file_local(struct m_config *config) +{ + for (struct m_config_option *co = config->opts; co; co = co->next) + ensure_backup(config, co); +} + // Given an option --opt, add --no-opt (if applicable). static void add_negation_option(struct m_config *config, struct m_config_option *parent, -- cgit v1.2.3 From 9fd2e449defa49128b07270ed9397970e0ca12ca Mon Sep 17 00:00:00 2001 From: wm4 Date: Sun, 21 Apr 2013 03:18:32 +0200 Subject: m_option: add function to check whether parameters are required To avoid that it will be duplicated with m_option.c and m_config.c. --- core/m_config.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'core/m_config.c') diff --git a/core/m_config.c b/core/m_config.c index 65d60bdab9..3781a92b90 100644 --- a/core/m_config.c +++ b/core/m_config.c @@ -585,10 +585,7 @@ int m_config_option_requires_param(struct m_config *config, bstr name) if (opt) { if (bstr_endswith0(name, "-clr")) return 0; - if (((opt->flags & M_OPT_OPTIONAL_PARAM) || - (opt->type->flags & M_OPT_TYPE_OPTIONAL_PARAM))) - return 0; - return 1; + return m_option_required_params(opt); } return M_OPT_UNKNOWN; } -- cgit v1.2.3