|
From: Petri H. <phi...@us...> - 2011-08-25 18:50:13
|
# HG changeset patch
# User Petri Hintukainen <phi...@us...>
# Date 1313322664 -10800
# Node ID 19ab4753ab1e866685b32b90ad64e88270e05ff6
# Parent 3c1b12f93a57d2b4799b9524b3782f284e083a46
Fixed multithreaded decoding with lavc >= 52.112.0.
avcodec_thread_init() was deprecated in lavc 52.112.0 (2011-02-09)
diff -r 3c1b12f93a57 -r 19ab4753ab1e src/combined/ffmpeg/ff_video_decoder.c
--- a/src/combined/ffmpeg/ff_video_decoder.c Tue Aug 09 16:05:27 2011 +0300
+++ b/src/combined/ffmpeg/ff_video_decoder.c Sun Aug 14 14:51:04 2011 +0300
@@ -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 @@
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;
}
|