[FFmpeg-devel] [PATCH] show-banner and show-license as cmdutils.c functions
Michael Niedermayer
michaelni
Sun Aug 5 16:25:37 CEST 2007
Hi
On Mon, Jul 16, 2007 at 01:46:50PM +0200, Stefano Sabatini wrote:
> Hi all,
>
> this patch implements the various show-banner and show-license
> functions in ffmpeg.c, ffserver.c and ffplay.c as calls to
> corresponding cmdutils.c:show_ffmpeg_license() and
> cmdutils.c:show_ffmpeg_banner() functions.
>
> Reduce code duplication in the command line utils programs.
>
> Note that it also changes the exit code of ffserver -L and ffmpeg -L
> >from 1 to 0, which seems to me the correct behaviour.
agree but this should be in a seperate patch
[...]
> @@ -3529,7 +3534,7 @@
>
> const OptionDef options[] = {
> /* main options */
> - { "L", 0, {(void*)show_license}, "show license" },
> + { "L", 0, {(void*)opt_show_license}, "show license" },
> { "h", 0, {(void*)show_help}, "show help" },
cosmetic
[...]
> Index: ffplay.c
> ===================================================================
> --- ffplay.c (revision 9682)
> +++ ffplay.c (working copy)
> @@ -2478,8 +2478,8 @@
>
> void show_help(void)
> {
> - printf("ffplay version " FFMPEG_VERSION ", Copyright (c) 2003-2007 Fabrice Bellard, et al.\n"
> - "usage: ffplay [options] input_file\n"
> + show_ffmpeg_banner(stderr);
> + printf("usage: ffplay [options] input_file\n"
> "Simple media player\n");
this changes stdout to stderr in half the code
[...]
> @@ -3780,6 +3781,11 @@
> }
> #endif
>
> +/* required for the inclusion of cmdutils.h */
> +void parse_arg_file(const char *filename)
> +{
> +}
> +
ugly hack
> static int parse_ffconfig(const char *filename)
> {
> FILE *f;
> @@ -4441,14 +4447,9 @@
> return 0;
> }
>
> -static void show_banner(void)
> -{
> - printf("ffserver version " FFMPEG_VERSION ", Copyright (c) 2000-2006 Fabrice Bellard, et al.\n");
> -}
> -
> static void show_help(void)
> {
> - show_banner();
> + show_ffmpeg_banner(stderr);
stdout->stderr change
also ffmpeg != ffserver, the code does not display the same thing after this
[...]
>
> +/*
> + * Note: in order to use this function you need to define in the program the
> + * meaning of the function parse_arg_file (eventually a function doing nothing).
> + */
> void parse_options(int argc, char **argv, const OptionDef *options)
> {
doesnt belong into this patch and should be doxygen compatible
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
I am the wisest man alive, for I know one thing, and that is that I know
nothing. -- Socrates
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070805/19084d9c/attachment.pgp>
More information about the ffmpeg-devel
mailing list