]> git.sesse.net Git - ffmpeg/commitdiff
avformat/udp: support w32pthreads compat
authorphunkyfish <phunkyfish@gmail.com>
Mon, 2 Mar 2020 20:48:41 +0000 (20:48 +0000)
committerMarton Balint <cus@passwd.hu>
Sun, 8 Mar 2020 18:08:04 +0000 (19:08 +0100)
Signed-off-by: Marton Balint <cus@passwd.hu>
compat/w32pthreads.h
libavformat/udp.c

index 7df33b7da4302eb25642d19fee9c2dd99bf2620c..6405e72b64f70b15e284c19734c26361846e95b9 100644 (file)
@@ -63,6 +63,9 @@ typedef CONDITION_VARIABLE pthread_cond_t;
 #define InitializeCriticalSection(x) InitializeCriticalSectionEx(x, 0, 0)
 #define WaitForSingleObject(a, b) WaitForSingleObjectEx(a, b, FALSE)
 
+#define PTHREAD_CANCEL_ENABLE 1
+#define PTHREAD_CANCEL_DISABLE 0
+
 static av_unused unsigned __stdcall attribute_align_arg win32thread_worker(void *arg)
 {
     pthread_t *h = (pthread_t*)arg;
@@ -180,4 +183,9 @@ static inline int pthread_cond_signal(pthread_cond_t *cond)
     return 0;
 }
 
+static inline int pthread_setcancelstate(int state, int *oldstate)
+{
+    return 0;
+}
+
 #endif /* COMPAT_W32PTHREADS_H */
index 23c3773c643f3f8adeaa540a8c20df305f5bdeff..ad6992c57dbc503d59fb6330fa944963f1d61885 100644 (file)
 #define IPPROTO_UDPLITE                                  136
 #endif
 
+#if HAVE_W32THREADS
+#undef HAVE_PTHREAD_CANCEL
+#define HAVE_PTHREAD_CANCEL 1
+#endif
+
 #if HAVE_PTHREAD_CANCEL
-#include <pthread.h>
+#include "libavutil/thread.h"
 #endif
 
 #ifndef IPV6_ADD_MEMBERSHIP