[MPlayer-dev-eng] [PATCH] Use the normal option parser for command line preparsing

Andrew Savchenko Bircoph at list.ru
Sun Apr 13 19:44:01 CEST 2008


Hi,

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 
behaviour.

So in order to make preparse routine all-purpose this issue should 
be solved. Who know what kind of options will be there in future?

Sincerely yours,
Andrew
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20080413/e3766387/attachment.pgp>


More information about the MPlayer-dev-eng mailing list