]> git.sesse.net Git - vlc/commitdiff
Pierre writes too good code. We need to kludge it :(
authorRémi Denis-Courmont <rem@videolan.org>
Sat, 22 Dec 2007 13:06:33 +0000 (13:06 +0000)
committerRémi Denis-Courmont <rem@videolan.org>
Sat, 22 Dec 2007 13:06:33 +0000 (13:06 +0000)
modules/services_discovery/sap.c

index cd4e0f3c3db010aacad1c3a93e4cffe81fed4143..171d756a706227af2e69c6236232dbd843cd986f 100644 (file)
@@ -543,7 +543,7 @@ static void Run( services_discovery_t *p_sd )
     }
 
     /* read SAP packets */
-    while( !p_sd->b_die )
+    while( vlc_object_alive( p_sd ) )
     {
         unsigned n = p_sd->p_sys->i_fd;
         struct pollfd ufd[n];
@@ -555,6 +555,11 @@ static void Run( services_discovery_t *p_sd )
             ufd[i].revents = 0;
         }
 
+        /* FIXME: remove this stupid evil hack when we have sorted out how to
+         * to cancel threads while doing network I/O */
+        if (timeout > 2000)
+            timeout = 2000;
+
         if (poll (ufd, n, timeout) > 0)
         {
             for (unsigned i = 0; i < n; i++)