On Sun, 20 Jan 2013 10:08:27 -0800
""Paweł Hajdan, Jr."" <phajdan...@gentoo.org> wrote:

> On 1/20/13 1:46 AM, Luca Barbato wrote:
> > On 19/01/13 20:10, "Paweł Hajdan, Jr." wrote:
> >> have a way to more simply exclude code that requires CODEC_ID_OPUS.
> > 
> > Exclude in chrome or in libavcodec?
> > 
> > The latter is a matter of adding --disable-decoder=opus and/or not
> > --enable-libopus in the configure.
> 
> Exclude in chrome, in case old ffmpeg/libav does not support it.


yes in this case you need some #if VERSION < foo conditions (git blame
& cie are your friends to obtain the version in which it appeared). it
becomes messy when you realize minor/micro versions within ffmpeg and
libav are not at all the same.

vlc has some macro for this:

http://git.videolan.org/?p=vlc.git;a=blob;f=modules/codec/avcodec/avcodec.h;h=8c8dd20ed3400527cab84265f4442bf06eb06f8d;hb=HEAD

/* LIBAVCODEC_VERSION_CHECK checks for the right version of libav and
FFmpeg 282  * a is the major version
* b and c the minor and micro versions of libav
* d and e the minor and micro versions of FFmpeg */
#define LIBAVCODEC_VERSION_CHECK( a, b, c, d, e ) \
     (LIBAVCODEC_VERSION_MICRO <  100 && LIBAVCODEC_VERSION_INT >=
     AV_VERSION_INT( a, b, c ) ) || \ 
     (LIBAVCODEC_VERSION_MICRO >= 100 && LIBAVCODEC_VERSION_INT >=
     AV_VERSION_INT( a, d, e ) )


_MICRO is >= 100 in ffmpeg so that you can distinguish between the two.


Another option could be to check for the enum member at configure
time.


Alexis.

Reply via email to