[FFmpeg-cvslog] cmdutils: Add -buildconf option.

Michael Niedermayer michaelni at gmx.at
Thu Nov 21 20:00:05 CET 2013


On Thu, Nov 21, 2013 at 12:55:53PM +0100, Clément Bœsch wrote:
> On Tue, Nov 19, 2013 at 10:32:32PM +0100, Stephen Hutchinson wrote:
> > ffmpeg | branch: master | Stephen Hutchinson <qyot27 at gmail.com> | Sun Aug 11 12:17:57 2013 -0400| [69cf626f9c1ba29e66ff62e2b835dcfc3031db8d] | committer: Michael Niedermayer
> > 
> > cmdutils: Add -buildconf option.
> > 
> > The output is formatted to display one option per line.
> > 
> > Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> > 
> > > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=69cf626f9c1ba29e66ff62e2b835dcfc3031db8d
> > ---
> > 
> >  cmdutils.c             |   34 ++++++++++++++++++++++++++++++++++
> >  cmdutils.h             |    7 +++++++
> >  cmdutils_common_opts.h |    1 +
> >  3 files changed, 42 insertions(+)
> > 
> > diff --git a/cmdutils.c b/cmdutils.c
> > index b10a552..e9545fe 100644
> > --- a/cmdutils.c
> > +++ b/cmdutils.c
> > @@ -1079,6 +1079,32 @@ static void print_program_info(int flags, int level)
> >      av_log(NULL, level, "%sconfiguration: " FFMPEG_CONFIGURATION "\n", indent);
> >  }
> >  
> > +static void print_buildconf(int flags, int level)
> > +{
> > +    const char *indent = flags & INDENT? "  " : "";
> > +    char str[] = { FFMPEG_CONFIGURATION };
> > +    char *conflist, *remove_tilde, *splitconf;
> > +
> 
> > +    // Change all the ' --' strings to '~--' so that
> > +    // they can be identified as tokens.
> > +    while( (conflist = strstr(str, " --")) != NULL ) {
> > +        strncpy(conflist, "~--", 3);
> > +    }
> > +
> > +    // Compensate for the weirdness this would cause
> > +    // when passing 'pkg-config --static'.
> > +    while( (remove_tilde = strstr(str, "pkg-config~")) != NULL ) {
> > +        strncpy(remove_tilde, "pkg-config ",11);
> > +    }
> > +
> 
> This hack is not enough to deal with a lot of similar options. It needs
> proper string escaping.
> 
> > +    splitconf = strtok(str, "~");
> 
> av_strtok()
> 
> > +    av_log(NULL, level, "\n%sconfiguration:\n",indent);
> > +    while(splitconf != NULL) {
> > +        av_log(NULL, level, "%s%s%s\n", indent, indent, splitconf);
> 
> See JSON_INDENT() in ffprobe.

CCing Stephen to make sure he sees the comments

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Awnsering whenever a program halts or runs forever is
On a turing machine, in general impossible (turings halting problem).
On any real computer, always possible as a real computer has a finite number
of states N, and will either halt in less than N cycles or never halt.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-cvslog/attachments/20131121/80f21e80/attachment.asc>


More information about the ffmpeg-cvslog mailing list