[FFmpeg-devel] [PATCH] Use LIBAVCODEC_BUILD rather than the deprecated avcodec_build() in cmdutils.c:show_version()
Måns Rullgård
mans
Sun Jul 13 23:33:29 CEST 2008
Stefano Sabatini <stefano.sabatini-lala at poste.it> writes:
> On date Sunday 2008-07-13 22:57:15 +0200, Michael Niedermayer encoded:
>> On Sun, Jul 13, 2008 at 07:08:44PM +0200, Stefano Sabatini wrote:
>> > avcodec_build() has been deprecated, LIBAV*_BUILD also look pointless
>> > so it seems better to directly use LIBAV*_VERSION_INT instead.
>> >
>> > Regards.
>> > --
>> > FFmpeg = Faboulous and Fostering Multimedia Pitiless Explosive God
>>
>> > Index: cmdutils.c
>> > ===================================================================
>> > --- cmdutils.c (revision 14208)
>> > +++ cmdutils.c (working copy)
>> > @@ -223,7 +223,7 @@
>> > "libavcodec %d\n"
>> > "libavformat %d\n"
>> > "libavdevice %d\n",
>> > - LIBAVUTIL_BUILD, avcodec_build(), LIBAVFORMAT_BUILD, LIBAVDEVICE_BUILD);
>> > + LIBAVUTIL_VERSION_INT, LIBAVCODEC_VERSION_INT, LIBAVFORMAT_VERSION_INT, LIBAVDEVICE_VERSION_INT);
>>
>> not ok
>> avcodec_build() is not the same as LIBAVCODEC_VERSION_INT
>
> That's right, new patch attached.
>
> BTW what's the plan for LIBAV*_BUILD, do you want to keep them or
> deprecate them in favour of LIBAV*_VERSION_INT?
>
> Regards.
> --
> FFmpeg = Fantastic and Faboulous Mega Power Entertaining Game
>
> Index: cmdutils.c
> ===================================================================
> --- cmdutils.c (revision 14208)
> +++ cmdutils.c (working copy)
> @@ -223,7 +223,7 @@
> "libavcodec %d\n"
> "libavformat %d\n"
> "libavdevice %d\n",
> - LIBAVUTIL_BUILD, avcodec_build(), LIBAVFORMAT_BUILD, LIBAVDEVICE_BUILD);
> + LIBAVUTIL_BUILD, LIBAVCODEC_BUILD, LIBAVFORMAT_BUILD, LIBAVDEVICE_BUILD);
> }
There is still a significant difference here. LIBAV*_BUILD and
LIBAV*_VERSION_INT have the same value, and for libavcodec, this value
is returned by both avcodec_build() and avcodec_version(). However,
the constants are determined at compile-time, whereas the functions
are bound at link-time (or runtime, for dynamic linking). Replacing
avcodec_build() with avcodec_version() should be equivalent.
I may of course be overlooking something that Michael has in mind, so
wait for his reply.
--
M?ns Rullg?rd
mans at mansr.com
More information about the ffmpeg-devel
mailing list