[vlc-devel] commit: Win32 old crappy poll replacement: misc fixes ( Rémi Denis-Courmont )

git version control git at videolan.org
Sun Jan 18 19:08:38 CET 2009


vlc | branch: master | Rémi Denis-Courmont <rdenis at simphalempin.com> | Sun Jan 18 20:08:23 2009 +0200| [60cc18a0326e9144fca3759048516b566cbba27f] | committer: Rémi Denis-Courmont 

Win32 old crappy poll replacement: misc fixes

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=60cc18a0326e9144fca3759048516b566cbba27f
---

 src/network/poll.c |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/src/network/poll.c b/src/network/poll.c
index 553a7e5..7aa314d 100644
--- a/src/network/poll.c
+++ b/src/network/poll.c
@@ -46,7 +46,11 @@ int vlc_poll (struct pollfd *fds, unsigned nfds, int timeout)
 {
     fd_set rdset, wrset, exset;
     struct timeval tv = { 0, 0 };
-    int val = -1;
+    int val;
+
+resume:
+    val = -1;
+    vlc_testcancel ();
 
     FD_ZERO (&rdset);
     FD_ZERO (&wrset);
@@ -87,13 +91,10 @@ int vlc_poll (struct pollfd *fds, unsigned nfds, int timeout)
 
 #ifndef HAVE_ALERTABLE_SELECT
 # warning FIXME! Fix cancellation and remove this crap.
-resume:
-    vlc_testcancel ();
-
     if ((timeout < 0) || (timeout > 50))
     {
         tv.tv_sec = 0;
-        tv.tv_usec = 50;
+        tv.tv_usec = 50000;
     }
     else
 #endif
@@ -105,10 +106,9 @@ resume:
     }
 
     val = select (val + 1, &rdset, &wrset, &exset,
-                  (timeout >= 0) ? &tv : NULL);
+                  /*(timeout >= 0) ?*/ &tv /*: NULL*/);
 
 #ifndef HAVE_ALERTABLE_SELECT
-# warning FIXME! Fix cancellation and remove this crap.
     if (val == 0)
     {
         if (timeout > 0)




More information about the vlc-devel mailing list