ref: 2a32644dd5405de231c87cb8e47275df85c580bd
parent: eb6899125ac83900710180c02b94bc593a1426d2
author: Paul Brossier <piem@piem.org>
date: Fri Aug 21 08:26:48 EDT 2015
src/io/source_avcodec.c: avoid deprecation warning, detect if we use ffmpeg or libav version
--- 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 <libavcodec/avcodec.h>
#include <libavformat/avformat.h>
#include <libavresample/avresample.h>
@@ -100,7 +103,11 @@
}
// 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 ) {