summaryrefslogtreecommitdiffstats
path: root/libavcodec/pthread.c
diff options
context:
space:
mode:
authorSteven Walters <kemuri9@gmail.com>2011-10-09 21:38:35 +0200
committerJanne Grunau <janne-libav@jannau.net>2011-10-16 21:45:16 +0200
commit27237d524e56210992b18486924894bb4f3fdbb8 (patch)
tree02477ac46ef62e3a9293a25b365698ed628e4038 /libavcodec/pthread.c
parentb44522981ce1f5da1d4ec62950b0933fc18ac223 (diff)
downloadffmpeg-streaming-27237d524e56210992b18486924894bb4f3fdbb8.zip
ffmpeg-streaming-27237d524e56210992b18486924894bb4f3fdbb8.tar.gz
w32threads: support for frame multithreading
Replace our incomplete w32threads implementation with x264's pthreads w32threads wrapper. Relicensed to LGPL with kind permission by Pegasys Inc. Signed-off-by: Janne Grunau <janne-libav@jannau.net>
Diffstat (limited to 'libavcodec/pthread.c')
-rw-r--r--libavcodec/pthread.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/libavcodec/pthread.c b/libavcodec/pthread.c
index 42f4382..d5129dc 100644
--- a/libavcodec/pthread.c
+++ b/libavcodec/pthread.c
@@ -29,11 +29,16 @@
* @see doc/multithreading.txt
*/
-#include <pthread.h>
-
+#include "config.h"
#include "avcodec.h"
#include "thread.h"
+#if HAVE_PTHREADS
+#include <pthread.h>
+#elif HAVE_W32THREADS
+#include "w32pthreads.h"
+#endif
+
typedef int (action_func)(AVCodecContext *c, void *arg);
typedef int (action_func2)(AVCodecContext *c, void *arg, int jobnr, int threadnr);
@@ -898,6 +903,10 @@ int ff_thread_init(AVCodecContext *avctx)
return -1;
}
+#if HAVE_W32THREADS
+ w32thread_init();
+#endif
+
if (avctx->codec) {
validate_thread_parameters(avctx);
OpenPOWER on IntegriCloud