]> git.sesse.net Git - mlt/commitdiff
fix SAMPLE_FMT support for v0.6 and less of libav/ffmpeg
authorDan Dennedy <dan@dennedy.org>
Sat, 28 Jan 2012 23:03:40 +0000 (15:03 -0800)
committerDan Dennedy <dan@dennedy.org>
Sat, 28 Jan 2012 23:03:40 +0000 (15:03 -0800)
src/modules/avformat/consumer_avformat.c
src/modules/avformat/filter_avresample.c
src/modules/avformat/producer_avformat.c

index 5fdf9b3d700e43fe7188e628e75334f56579d4c1..a4aa08d25c07f22f15a2a1a27b4c1146904c677e 100644 (file)
 #if LIBAVUTIL_VERSION_INT >= ((50<<16)+(8<<8)+0)
 #include <libavutil/pixdesc.h>
 #endif
+#include <libavutil/mathematics.h>
+
 #if LIBAVUTIL_VERSION_INT >= ((50<<16)+(38<<8)+0)
-#include <libavutil/samplefmt.h>
+#  include <libavutil/samplefmt.h>
+#else
+#  define AV_SAMPLE_FMT_S16 SAMPLE_FMT_S16
+#  define AV_SAMPLE_FMT_S32 SAMPLE_FMT_S32
+#  define AV_SAMPLE_FMT_FLT SAMPLE_FMT_FLT
 #endif
-#include <libavutil/mathematics.h>
 
 #if LIBAVUTIL_VERSION_INT < (50<<16)
 #define PIX_FMT_RGB32 PIX_FMT_RGBA32
index 94d677f17682414cce23f3cbc32ed1feb0f4ae89..65ea354e9ea6862d5c8aa99785a2f7b9ad8c0b16 100644 (file)
@@ -29,7 +29,9 @@
 // ffmpeg Header files
 #include <libavformat/avformat.h>
 #if LIBAVUTIL_VERSION_INT >= ((50<<16)+(38<<8)+0)
-#include <libavutil/samplefmt.h>
+#  include <libavutil/samplefmt.h>
+#else
+#  define AV_SAMPLE_FMT_S16 SAMPLE_FMT_S16
 #endif
 
 /** Get the audio.
index 8476f90f59cc83c75e619c003eaa9cc178dcd92b..0102b19bd4a06fe4a60a13d67642632ce50946b4 100644 (file)
 #ifdef SWSCALE
 #  include <libswscale/swscale.h>
 #endif
+
 #if LIBAVUTIL_VERSION_INT >= ((50<<16)+(38<<8)+0)
-#include <libavutil/samplefmt.h>
-#elif (LIBAVCODEC_VERSION_INT >= ((51<<16)+(71<<8)+0))
+#  include <libavutil/samplefmt.h>
+#else
+#  define AV_SAMPLE_FMT_S16 SAMPLE_FMT_S16
+#  define AV_SAMPLE_FMT_S32 SAMPLE_FMT_S32
+#  define AV_SAMPLE_FMT_FLT SAMPLE_FMT_FLT
+#  if (LIBAVCODEC_VERSION_INT >= ((51<<16)+(71<<8)+0))
 const char *avcodec_get_sample_fmt_name(int sample_fmt);
+#  endif
 #endif
+
 #ifdef VDPAU
 #  include <libavcodec/vdpau.h>
 #endif