[FFmpeg-cvslog] cmdutils: Add -buildconf option.
Clément Bœsch
u at pkh.me
Thu Nov 21 12:55:53 CET 2013
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.
[...]
--
Clément B.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 490 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-cvslog/attachments/20131121/b680a356/attachment.asc>
More information about the ffmpeg-cvslog
mailing list