[MPlayer-dev-eng] [PATCH] Use the normal option parser for command line preparsing
albeu at free.fr
Sun Apr 13 20:57:46 CEST 2008
On Sun, 13 Apr 2008 21:44:01 +0400
Andrew Savchenko <Bircoph at list.ru> wrote:
> On Sunday 13 April 2008 21:36, Alban Bedel wrote:
> > After a few more reflections it's simpler and more logic to
> > simply skip them when in command line mode instead of when not
> > in command line preparsing mode. New patch attached.
> Ok, and thanks for explanations in your previous e-mail.
> > Index: m_config.c
> > ================================================================
> >=== --- m_config.c (revision 26439)
> > +++ m_config.c (working copy)
> > @@ -308,6 +308,13 @@
> > mp_msg(MSGT_CFGPARSER,
> > MSGL_ERR,MSGTR_InvalidCmdlineOption,arg); return M_OPT_INVALID;
> > }
> > + // During command line preparse set only pre-parse options
> > + // During command line parse don't set pre-parse options
> > + if(((config->mode == M_COMMAND_LINE_PRE_PARSE) &&
> > + !(co->opt->flags & M_OPT_PRE_PARSE)) ||
> > + ((config->mode == M_COMMAND_LINE) &&
> > + (co->opt->flags & M_OPT_PRE_PARSE)))
> With currently available preparsed options this will work fine:
> -really-quiet has no options and -noconfig is command line only.
> But in the case when preparsed option has an argument and is
> specified in both command line and config file, the config's value
> will override the console line's one, and this is not a desirable
Yes, that could happen, so here is a patch implementing this.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 5933 bytes
Desc: not available
More information about the MPlayer-dev-eng