[vlc-commits] Win32: really fix poll() loop *cough* *cough*

Rémi Denis-Courmont git at videolan.org
Tue Feb 5 18:56:35 CET 2013


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Tue Feb  5 19:55:29 2013 +0200| [7724ba6c06a08e92954d33fda4d9dd62916d9dcc] | committer: Rémi Denis-Courmont

Win32: really fix poll() loop *cough* *cough*

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

 include/vlc_threads.h |    8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/include/vlc_threads.h b/include/vlc_threads.h
index 1197b55..12b56fd 100644
--- a/include/vlc_threads.h
+++ b/include/vlc_threads.h
@@ -392,11 +392,9 @@ static inline int vlc_poll (struct pollfd *fds, unsigned nfds, int timeout)
 
     do
     {
-        int ugly_timeout = 50;
-        if (timeout >= 50)
-            timeout -= 50;
-        else if ((unsigned)timeout < 50u)
-            ugly_timeout = timeout;
+        int ugly_timeout = ((unsigned)timeout >= 50) ? 50 : timeout;
+        if (timeout >= 0)
+            timeout -= ugly_timeout;
 
         vlc_testcancel ();
         val = poll (fds, nfds, ugly_timeout);



More information about the vlc-commits mailing list