summaryrefslogtreecommitdiffstats
path: root/m_config.c
diff options
context:
space:
mode:
authoralbeu <albeu@b3059339-0415-0410-9bf9-f77b7e298cf2>2008-04-13 19:18:51 +0000
committeralbeu <albeu@b3059339-0415-0410-9bf9-f77b7e298cf2>2008-04-13 19:18:51 +0000
commite4dc453ea095c1c3e282d5b6cc1370c74abb76cf (patch)
tree8a849caffbabb6308b2fb54e3581fa5797391513 /m_config.c
parentd08bf2fc44100bc4ee8400de1b8704519225533c (diff)
downloadmpv-e4dc453ea095c1c3e282d5b6cc1370c74abb76cf.tar.bz2
mpv-e4dc453ea095c1c3e282d5b6cc1370c74abb76cf.tar.xz
Replace the trivial command line preparser with a more robust version
allowing all kind of options to be used. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26440 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'm_config.c')
-rw-r--r--m_config.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/m_config.c b/m_config.c
index c030b13233..263144813e 100644
--- a/m_config.c
+++ b/m_config.c
@@ -308,6 +308,13 @@ m_config_parse_option(m_config_t *config, char* arg, char* param,int set) {
mp_msg(MSGT_CFGPARSER, MSGL_ERR,MSGTR_InvalidCmdlineOption,arg);
return M_OPT_INVALID;
}
+ // During command line preparse set only pre-parse options
+ // Otherwise only set pre-parse option if they were not already set.
+ if(((config->mode == M_COMMAND_LINE_PRE_PARSE) &&
+ !(co->opt->flags & M_OPT_PRE_PARSE)) ||
+ ((config->mode != M_COMMAND_LINE_PRE_PARSE) &&
+ (co->opt->flags & M_OPT_PRE_PARSE) && (co->flags & M_CFG_OPT_SET)))
+ set = 0;
// Option with children are a bit different to parse
if(co->opt->type->flags & M_OPT_TYPE_HAS_CHILD) {