From 2b858b45c26b52cdbf80528b6445248adc8eb7f1 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Sun, 26 Jan 2014 13:22:26 +0100 Subject: audaspace: use new libavcodec audio encoding API where available --- intern/ffmpeg/ffmpeg_compat.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'intern/ffmpeg') diff --git a/intern/ffmpeg/ffmpeg_compat.h b/intern/ffmpeg/ffmpeg_compat.h index 91db329592d..58cf62ab623 100644 --- a/intern/ffmpeg/ffmpeg_compat.h +++ b/intern/ffmpeg/ffmpeg_compat.h @@ -90,6 +90,10 @@ #define FFMPEG_HAVE_DECODE_AUDIO4 #endif +#if ((LIBAVCODEC_VERSION_MAJOR > 54) || (LIBAVCODEC_VERSION_MAJOR >= 54) && (LIBAVCODEC_VERSION_MINOR >= 13)) +#define FFMPEG_HAVE_AVFRAME_SAMPLE_RATE +#endif + #if ((LIBAVUTIL_VERSION_MAJOR > 51) || (LIBAVUTIL_VERSION_MAJOR == 51) && (LIBAVUTIL_VERSION_MINOR >= 21)) #define FFMPEG_FFV1_ALPHA_SUPPORTED #define FFMPEG_SAMPLE_FMT_S16P_SUPPORTED @@ -267,6 +271,10 @@ void avcodec_free_frame(AVFrame **frame) } #endif +#if ((LIBAVCODEC_VERSION_MAJOR > 54) || (LIBAVCODEC_VERSION_MAJOR >= 54) && (LIBAVCODEC_VERSION_MINOR >= 13)) +#define FFMPEG_HAVE_AVFRAME_SAMPLE_RATE +#endif + #if ((LIBAVCODEC_VERSION_MAJOR > 54) || (LIBAVCODEC_VERSION_MAJOR == 54 && LIBAVCODEC_VERSION_MINOR >= 13)) #define FFMPEG_HAVE_FRAME_CHANNEL_LAYOUT #endif @@ -397,4 +405,18 @@ void avformat_close_input(AVFormatContext **ctx) } #endif +#if LIBAVUTIL_VERSION_INT < AV_VERSION_INT(52, 8, 0) +FFMPEG_INLINE +AVFrame *av_frame_alloc(void) +{ + return avcodec_alloc_frame(); +} + +FFMPEG_INLINE +void av_frame_free(AVFrame **frame) +{ + av_freep(frame); +} +#endif + #endif -- cgit v1.2.3