From: Paul Brossier Date: Fri, 21 Aug 2015 10:26:48 +0000 (+0200) Subject: src/io/source_avcodec.c: avoid deprecation warning, detect if we use ffmpeg or libav... X-Git-Tag: 0.4.4~301^2~19 X-Git-Url: https://git.aubio.org/?a=commitdiff_plain;h=2a32644dd5405de231c87cb8e47275df85c580bd;p=aubio.git src/io/source_avcodec.c: avoid deprecation warning, detect if we use ffmpeg or libav version --- diff --git a/src/io/source_avcodec.c b/src/io/source_avcodec.c index 22d22974..5cfd27de 100644 --- a/src/io/source_avcodec.c +++ b/src/io/source_avcodec.c @@ -23,6 +23,9 @@ #ifdef HAVE_LIBAV +// determine whether we use libavformat from ffmpe or libav +#define FFMPEG_LIBAVFORMAT (LIBAVFORMAT_VERSION_MICRO > 99) + #include #include #include @@ -100,7 +103,11 @@ aubio_source_avcodec_t * new_aubio_source_avcodec(char_t * path, uint_t samplera } // try to make sure max_analyze_duration is big enough for most songs +#if FFMPEG_LIBAVFORMAT + avFormatCtx->max_analyze_duration2 *= 100; +#else avFormatCtx->max_analyze_duration *= 100; +#endif // retrieve stream information if ( (err = avformat_find_stream_info(avFormatCtx, NULL)) < 0 ) {