From c360fb174b01170ab3fd3048d4d0acb44aa4e834 Mon Sep 17 00:00:00 2001
From: Jean-Baptiste Kempf <jb@videolan.org>
Date: Tue, 14 May 2013 11:34:53 +0200
Subject: [PATCH] win32: Do not use GetProcAddress when compiled for Vista+
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Instead link directly to the condition variable functions.

Signed-off-by: Martin Storsjö <martin@martin.st>
---
 libavcodec/w32pthreads.h | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/libavcodec/w32pthreads.h b/libavcodec/w32pthreads.h
index 91e7353fbb8..c58da49a618 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 */
-- 
GitLab