From 5306a37c61291161102d4834491b16211d8c6b28 Mon Sep 17 00:00:00 2001 From: Petri Hintukainen Date: Sun, 14 Aug 2011 14:51:04 +0300 Subject: Fixed multithreaded decoding with lavc >= 52.112.0. avcodec_thread_init() was deprecated in lavc 52.112.0 (2011-02-09) --- src/combined/ffmpeg/ff_video_decoder.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/combined/ffmpeg/ff_video_decoder.c b/src/combined/ffmpeg/ff_video_decoder.c index a9c383c48..d1c2fcb5b 100644 --- a/src/combined/ffmpeg/ff_video_decoder.c +++ b/src/combined/ffmpeg/ff_video_decoder.c @@ -66,6 +66,10 @@ # define pp_mode pp_mode_t #endif +#if LIBAVCODEC_VERSION_MAJOR >= 53 || (LIBAVCODEC_VERSION_MAJOR == 52 && LIBAVCODEC_VERSION_MINOR >= 112) +# define DEPRECATED_AVCODEC_THREAD_INIT 1 +#endif + /* reordered_opaque appeared in libavcodec 51.68.0 */ #define AVCODEC_HAS_REORDERED_OPAQUE #if LIBAVCODEC_VERSION_INT < 0x334400 @@ -365,7 +369,10 @@ static void init_video_codec (ff_video_decoder_t *this, unsigned int codec_type) if (this->class->thread_count > 1) { if (this->codec->id != CODEC_ID_SVQ3 - && avcodec_thread_init(this->context, this->class->thread_count) != -1) +#ifndef DEPRECATED_AVCODEC_THREAD_INIT + && avcodec_thread_init(this->context, this->class->thread_count) != -1 +#endif + ) this->context->thread_count = this->class->thread_count; } -- cgit v1.2.3