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

Alban Bedel albeu at free.fr
Sun Apr 13 19:36:23 CEST 2008


On Sun, 13 Apr 2008 19:13:48 +0200
Alban Bedel <albeu at free.fr> wrote:

> On Sun, 13 Apr 2008 20:33:42 +0400
> Andrew Savchenko <Bircoph at list.ru> wrote:
> 
> > Hi,
> > 
> > On Sunday 13 April 2008 18:52, Alban Bedel wrote:
> > > 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 pre-parse don't set non-pre-parse options
> > > +  // Otherwise 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_PRE_PARSE) &&
> > > +      (co->opt->flags & M_OPT_PRE_PARSE)))
> > 
> > The problem is here. Just imagine that option is marked as 
> > CONF_PRE_PARSE and is not specified in the command line, but is 
> > specified in the config file. It such case option just will be 
> > ignored.
> > 
> > I suggest to add another flag (e.g. M_OPT_PREPARSE_DONE) and toggle 
> > it while preparsing, and only skip option at the main parse if 
> > this flag is set.
> 
> I see what you mean, I'll do that.

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.

	Albeu
-------------- next part --------------
A non-text attachment was scrubbed...
Name: preparse_cmd_line-2.diff
Type: text/x-diff
Size: 5895 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20080413/b018919a/attachment.diff>


More information about the MPlayer-dev-eng mailing list