summaryrefslogtreecommitdiff
path: root/libavcodec
diff options
context:
space:
mode:
authorJean-Baptiste Kempf <jb@videolan.org>2013-05-14 11:34:53 +0200
committerMartin Storsjö <martin@martin.st>2013-05-19 18:22:39 +0300
commitc360fb174b01170ab3fd3048d4d0acb44aa4e834 (patch)
tree4ef1dd70012ad6c9fb6d7088c48790e0192bd5f8 /libavcodec
parent0b6899f154347cdd0aa66c5ec16ed9c65871766f (diff)
win32: Do not use GetProcAddress when compiled for Vista+
Instead link directly to the condition variable functions. Signed-off-by: Martin Storsjö <martin@martin.st>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/w32pthreads.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/libavcodec/w32pthreads.h b/libavcodec/w32pthreads.h
index 91e7353fbb..c58da49a61 100644
--- a/libavcodec/w32pthreads.h
+++ b/libavcodec/w32pthreads.h
@@ -256,6 +256,7 @@ static void pthread_cond_signal(pthread_cond_t *cond)
static void w32thread_init(void)
{
+#if _WIN32_WINNT < 0x0600
HANDLE kernel_dll = GetModuleHandle(TEXT("kernel32.dll"));
/* if one is available, then they should all be available */
cond_init =
@@ -266,6 +267,13 @@ static void w32thread_init(void)
(void*)GetProcAddress(kernel_dll, "WakeConditionVariable");
cond_wait =
(void*)GetProcAddress(kernel_dll, "SleepConditionVariableCS");
+#else
+ cond_init = InitializeConditionVariable;
+ cond_broadcast = WakeAllConditionVariable;
+ cond_signal = WakeConditionVariable;
+ cond_wait = SleepConditionVariableCS;
+#endif
+
}
#endif /* AVCODEC_W32PTHREADS_H */