From 2a32644dd5405de231c87cb8e47275df85c580bd Mon Sep 17 00:00:00 2001 From: Paul Brossier Date: Fri, 21 Aug 2015 12:26:48 +0200 Subject: [PATCH] src/io/source_avcodec.c: avoid deprecation warning, detect if we use ffmpeg or libav version --- src/io/source_avcodec.c | 7 +++++++ 1 file changed, 7 insertions(+) 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 ) { -- 2.11.0