Windows Vista and later have a WSAPoll() function equivalent to the
standard poll().  Use this instead of emulating it with select()
when possible.
---
This is completely untested.  Help with that would be appreciated.
---
 configure                |    2 ++
 libavformat/os_support.h |    5 +++++
 2 files changed, 7 insertions(+)

diff --git a/configure b/configure
index 0a40bf6..5dfa906 100755
--- a/configure
+++ b/configure
@@ -1161,6 +1161,7 @@ HAVE_LIST="
     vfp_args
     VirtualAlloc
     winsock2_h
+    WSAPoll
     xform_asm
     xmm_clobbers
     yasm
@@ -2852,6 +2853,7 @@ if enabled network; then
             network_extralibs="-lws2" || \
         { check_func_headers winsock2.h closesocket -lws2_32 && \
             network_extralibs="-lws2_32"; }
+        check_func_headers winsock2.h WSAPoll $network_extralibs
         check_type ws2tcpip.h socklen_t
         check_type ws2tcpip.h "struct addrinfo"
         check_type ws2tcpip.h "struct ipv6_mreq"
diff --git a/libavformat/os_support.h b/libavformat/os_support.h
index 3db20a9..234150c 100644
--- a/libavformat/os_support.h
+++ b/libavformat/os_support.h
@@ -73,6 +73,10 @@ typedef int socklen_t;
 #endif
 
 #if !HAVE_POLL_H
+#if HAVE_WSAPOLL
+#include <winsock2.h>
+#define poll WSAPoll
+#else
 typedef unsigned long nfds_t;
 
 struct pollfd {
@@ -97,6 +101,7 @@ struct pollfd {
 
 
 int poll(struct pollfd *fds, nfds_t numfds, int timeout);
+#endif /* HAVE_WSAPOLL */
 #endif /* HAVE_POLL_H */
 #endif /* CONFIG_NETWORK */
 
-- 
1.7.10.2

_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to