summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPetri Hintukainen <phintuka@users.sourceforge.net>2011-08-14 14:51:04 +0300
committerPetri Hintukainen <phintuka@users.sourceforge.net>2011-08-14 14:51:04 +0300
commit5306a37c61291161102d4834491b16211d8c6b28 (patch)
tree7c9390338cb4fc2d473e82b7c2c7fe1c2a9c489c
parent1a9361785cdde74feff211fc48a783ba154bc958 (diff)
downloadxine-lib-5306a37c61291161102d4834491b16211d8c6b28.tar.gz
xine-lib-5306a37c61291161102d4834491b16211d8c6b28.tar.bz2
Fixed multithreaded decoding with lavc >= 52.112.0.
avcodec_thread_init() was deprecated in lavc 52.112.0 (2011-02-09)
-rw-r--r--src/combined/ffmpeg/ff_video_decoder.c9
1 files changed, 8 insertions, 1 deletions
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;
}