[FFmpeg-devel] [RFC] print license and configuration for each lib

Måns Rullgård mans
Fri Oct 30 21:54:16 CET 2009


Reimar D?ffinger <Reimar.Doeffinger at gmx.de> writes:

> On Fri, Oct 30, 2009 at 07:54:40PM +0000, M?ns Rullg?rd wrote:
>> Diego Biurrun <diego at biurrun.de> writes:
>> >> > Like I have done in $attached for libavcodec?  Anything else?
>> >> >
>> >> > +const char* avcodec_license(void)
>> >> > +{
>> >> > +    return "libavcodec license: " FFMPEG_LICENSE "\n";
>> >> > +}
>> >> 
>> >> Drop the "libfoo thing:" prefixes.  Whatever is using the string can
>> >> add those in a way that makes sense in its context.
>> >
>> > I agree that this would likely be more flexible, but note that I have a
>> > vested interest in seeing this exact string appear in the lib binary :)
>> 
>> Then return a pointer part-way into the string.
>
> Just in case it is not clear e.g.:
> #define LICENSEHDR "libavcodec license: "
> return LICENSEHDR FFMPEG_LICENSE + strlen(LICENSEHDR);

If you don't trust the compiler to optimise the strlen(), which I
dont, use sizeof(LICENSEHDR)-1.

-- 
M?ns Rullg?rd
mans at mansr.com



More information about the ffmpeg-devel mailing list