[FFmpeg-devel] [PATCH] Define cmdline_program_name and use it in show_help

Benoit Fouet ml_benoitfouet
Tue Oct 28 09:08:10 CET 2008


Hi,

Stefano Sabatini wrote:
> On date Monday 2008-10-27 13:46:24 +0100, Luca Abeni encoded:
>   
>> Hi all,
>>
>> Aurelien Jacobs wrote:
>> [...]
>>     
>>>>> Index: ffmpeg.c
>>>>> ===================================================================
>>>>> --- ffmpeg.c      (revision 15712)
>>>>> +++ ffmpeg.c      (working copy)
>>>>> @@ -71,6 +71,7 @@
>>>>>  #undef exit
>>>>>
>>>>>  const char program_name[] = "FFmpeg";
>>>>> +const char* cmdline_program_name = NULL;
>>>>>
>>>>>           
>>>> why is it not static ? btw, I'd prefer char *foo to char* foo, but maybe
>>>> that's just me...
>>>>         
>>> I also prefer char *foo.
>>> And no need to initialize it to NULL.
>>>       
>
> OK.
>
>   
>> Maybe this is a stupid question, but... Why using a global variable instead
>> of passing argv[0] as an argument to show_help() (in ffplay.c and ffmpeg.c)?
>>     
>
> For consistency with program_name, no strong opinion on this.
>
> And yes the variable should be declared static as well program_name
> and program_birthyear, patch will follow for that.
>
>   

no, they should not... program_name and program_birthyear are used in
cmdutils

> Index: ffmpeg.c
> ===================================================================
> --- ffmpeg.c	(revision 15712)
> +++ ffmpeg.c	(working copy)
> @@ -71,6 +71,7 @@
>  #undef exit
>  
>  const char program_name[] = "FFmpeg";
> +const char *cmdline_program_name;
>   

ahum...

>  const int program_birth_year = 2000;
>  
> Index: ffplay.c
> ===================================================================
> --- ffplay.c	(revision 15712)
> +++ ffplay.c	(working copy)
> @@ -41,6 +41,7 @@
>  #undef exit
>  
>  const char program_name[] = "FFplay";
> +const char *cmdline_program_name;
>   

dito

>  const int program_birth_year = 2003;
>  
> Index: ffserver.c
> ===================================================================
> --- ffserver.c	(revision 15712)
> +++ ffserver.c	(working copy)
> @@ -58,6 +58,7 @@
>  #undef exit
>  
>  const char program_name[] = "FFserver";
> +const char *cmdline_program_name;
>   

and again...

>  const int program_birth_year = 2000;
>   

-- 
Benoit Fouet
Purple Labs S.A.
www.purplelabs.com





More information about the ffmpeg-devel mailing list