[FFmpeg-devel] [PATCH] Get avcodec configuration at runtime.

Ramiro Polla ramiro.polla
Mon Jan 25 03:29:42 CET 2010


2010/1/25 M?ns Rullg?rd <mans at mansr.com>:
> Ramiro Polla <ramiro.polla at gmail.com> writes:
>> On Thu, Jan 21, 2010 at 6:43 PM, Reinhard Tartler <siretart at tauware.de> wrote:
>>> On Do, Jan 21, 2010 at 21:23:10 (CET), M?ns Rullg?rd wrote:
>>>> Ramiro Polla <ramiro.polla at gmail.com> writes:
>>>>> Currently cmdutils.c hardcodes FFMPEG_CONFIGURATION to print out in
>>>>> the banner. This is a problem when someone updates libavcodec and
>>>>> keeps the same ffmpeg executable. For example debian has different
>>>>> libavcodec packages with different codecs enabled.
>>>
>>> That's ubuntu. debian (currently) allows only the crippled version.
>>>
>>>>> Attached patch makes cmdutils.c use avcodec_configuration(), but
>>>>> that's not good also because people might have mixed libav* libraries
>>>>> around.
>>>>>
>>>>> Suggestions welcome...
>>>>
>>>> Print all of them. ?To avoid ugly clutter we could check if they are
>>>> all the same and print it only once if they are.
>>>
>>> sounds most usable.
>>
>> Patch attached.
>>
>> Index: cmdutils.c
>> ===================================================================
>> --- cmdutils.c ? ? ? ?(revision 21440)
>> +++ cmdutils.c ? ? ? ?(working copy)
>> @@ -352,7 +352,30 @@
>> ? ? ? ? ? ? ?program_name, program_birth_year, this_year);
>> ? ? ?fprintf(stderr, " ?built on %s %s with %s %s\n",
>> ? ? ? ? ? ? ?__DATE__, __TIME__, CC_TYPE, CC_VERSION);
>> + ? ?if (strcmp(avcodec_configuration(), avdevice_configuration()) ||
>> +#if CONFIG_AVFILTER
>> + ? ? ? ?strcmp(avcodec_configuration(), avfilter_configuration()) ||
>> +#endif
>> + ? ? ? ?strcmp(avcodec_configuration(), avformat_configuration()) ||
>> + ? ? ? ?strcmp(avcodec_configuration(), avutil_configuration ?()) ||
>> +#if CONFIG_POSTPROC
>> + ? ? ? ?strcmp(avcodec_configuration(), postproc_configuration()) ||
>> +#endif
>> + ? ? ? ?strcmp(avcodec_configuration(), swscale_configuration ())) {
>> + ? ? ? ?fprintf(stderr, " ?WARNING: library configurations are mismatched!\n");
>> + ? ? ? ?fprintf(stderr, " ?avcodec ?configuration: %s\n", avcodec_configuration ());
>> +#if CONFIG_AVFILTER
>> + ? ? ? ?fprintf(stderr, " ?avfilter configuration: %s\n", avfilter_configuration());
>> +#endif
>> + ? ? ? ?fprintf(stderr, " ?avformat configuration: %s\n", avformat_configuration());
>> + ? ? ? ?fprintf(stderr, " ?avutil ? configuration: %s\n", avutil_configuration ?());
>> +#if CONFIG_POSTPROC
>> + ? ? ? ?fprintf(stderr, " ?postproc configuration: %s\n", postproc_configuration());
>> +#endif
>> + ? ? ? ?fprintf(stderr, " ?swscale ?configuration: %s\n", swscale_configuration ());
>> + ? ?} else {
>> ? ? ?fprintf(stderr, " ?configuration: " FFMPEG_CONFIGURATION "\n");
>> + ? ?}
>> ? ? ?print_all_lib_versions(stderr, 1);
>> ?}
>
> This is totally unreadable.

I don't know what could make it much more readable, but new something attached.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mismatched_configurations_2.diff
Type: text/x-diff
Size: 1706 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100125/e3d4273c/attachment.diff>



More information about the ffmpeg-devel mailing list