From a377cfa6c2d68f6feec4cb2aa9b87d7ec07340e7 Mon Sep 17 00:00:00 2001 From: Aurelien Jacobs Date: Thu, 30 Sep 2010 15:37:01 +0000 Subject: [PATCH] add FF_API_AUDIO_OLD define to disable the deprecated decode_audio API Originally committed as revision 25270 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavcodec/avcodec.h | 7 +++++-- libavcodec/resample.c | 2 +- libavcodec/utils.c | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h index 3667e723d6..e701a82857 100644 --- a/libavcodec/avcodec.h +++ b/libavcodec/avcodec.h @@ -57,6 +57,9 @@ #ifndef FF_API_OPT_SHOW #define FF_API_OPT_SHOW (LIBAVCODEC_VERSION_MAJOR < 53) #endif +#ifndef FF_API_AUDIO_OLD +#define FF_API_AUDIO_OLD (LIBAVCODEC_VERSION_MAJOR < 53) +#endif #define AV_NOPTS_VALUE INT64_C(0x8000000000000000) #define AV_TIME_BASE 1000000 @@ -2998,7 +3001,7 @@ struct AVResampleContext; typedef struct ReSampleContext ReSampleContext; -#if LIBAVCODEC_VERSION_MAJOR < 53 +#if FF_API_AUDIO_OLD /** * @deprecated Use av_audio_resample_init() instead. */ @@ -3459,7 +3462,7 @@ int avcodec_default_execute2(AVCodecContext *c, int (*func)(AVCodecContext *c2, */ int avcodec_open(AVCodecContext *avctx, AVCodec *codec); -#if LIBAVCODEC_VERSION_MAJOR < 53 +#if FF_API_AUDIO_OLD /** * Decode an audio frame from buf into samples. * Wrapper function which calls avcodec_decode_audio3. diff --git a/libavcodec/resample.c b/libavcodec/resample.c index e51b4fc667..222b28ce83 100644 --- a/libavcodec/resample.c +++ b/libavcodec/resample.c @@ -217,7 +217,7 @@ ReSampleContext *av_audio_resample_init(int output_channels, int input_channels, return s; } -#if LIBAVCODEC_VERSION_MAJOR < 53 +#if FF_API_AUDIO_OLD ReSampleContext *audio_resample_init(int output_channels, int input_channels, int output_rate, int input_rate) { diff --git a/libavcodec/utils.c b/libavcodec/utils.c index 7edff412ec..69439b896b 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -630,7 +630,7 @@ int attribute_align_arg avcodec_decode_video2(AVCodecContext *avctx, AVFrame *pi return ret; } -#if LIBAVCODEC_VERSION_MAJOR < 53 +#if FF_API_AUDIO_OLD int attribute_align_arg avcodec_decode_audio2(AVCodecContext *avctx, int16_t *samples, int *frame_size_ptr, const uint8_t *buf, int buf_size)