From 349b71fd02354a3d1288bccbb2d984d5f9a7e605 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Fri, 19 Apr 2013 17:23:08 +0000 Subject: Bring back support of FFmpeg >= 0.7 After planar codecs support minimal FFmpeg was bumped to 0.10 which was not so much nice because it was only released only later last year. Didn't find a way to make compatibility code local in ffmpeg_compat, so there're some ifdefs in audaspace and writeffmpeg. Not entirely happy, but having a bit of ifdefs in code better than lots of real PITA for platform maintainers. --- intern/ffmpeg/ffmpeg_compat.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'intern/ffmpeg/ffmpeg_compat.h') diff --git a/intern/ffmpeg/ffmpeg_compat.h b/intern/ffmpeg/ffmpeg_compat.h index e072796abc4..0f97d1d42cc 100644 --- a/intern/ffmpeg/ffmpeg_compat.h +++ b/intern/ffmpeg/ffmpeg_compat.h @@ -76,9 +76,26 @@ #define FFMPEG_HAVE_CANON_H264_RESOLUTION_FIX #endif +#if ((LIBAVCODEC_VERSION_MAJOR > 53) || (LIBAVCODEC_VERSION_MAJOR >= 53) && (LIBAVCODEC_VERSION_MINOR >= 60)) +#define FFMPEG_HAVE_ENCODE_AUDIO2 +#endif + +#if ((LIBAVCODEC_VERSION_MAJOR > 53) || (LIBAVCODEC_VERSION_MAJOR >= 53) && (LIBAVCODEC_VERSION_MINOR >= 42)) +#define FFMPEG_HAVE_DECODE_AUDIO4 +#endif + #if ((LIBAVUTIL_VERSION_MAJOR > 51) || (LIBAVUTIL_VERSION_MAJOR == 51) && (LIBAVUTIL_VERSION_MINOR >= 32)) #define FFMPEG_FFV1_ALPHA_SUPPORTED #define FFMPEG_SAMPLE_FMT_S16P_SUPPORTED +#else + +static inline +int av_sample_fmt_is_planar(enum AVSampleFormat sample_fmt) +{ + /* no planar formats in FFmpeg < 0.9 */ + return 0; +} + #endif static inline -- cgit v1.2.3