]> git.sesse.net Git - vlc/commitdiff
Also try to send twice without splice().
authorRémi Denis-Courmont <rem@videolan.org>
Thu, 27 Sep 2007 17:08:23 +0000 (17:08 +0000)
committerRémi Denis-Courmont <rem@videolan.org>
Thu, 27 Sep 2007 17:08:23 +0000 (17:08 +0000)
This means ICMP errors will be ignored, which is a Bad Idea.
But people are likely to complain about how it breaks their setup if we
don't ignore ICMP anyway.

modules/stream_out/rtp.c

index 4c3a6ed6ea531351ffe9ee0eefcead7baddece69..fb93f2346a27c3d069d9f5e18291d4fd1ed6eb95 100644 (file)
@@ -1390,13 +1390,20 @@ static void ThreadSend( vlc_object_t *p_this )
             if( splice( fd[2], NULL, id->sinkv[i].rtp_fd, NULL, len,
                         SPLICE_F_NONBLOCK ) >= 0 )
                 continue;
+            if( errno == EAGAIN )
+                continue;
 
             /* splice failed */
             splice( fd[2], NULL, fd[4], NULL, len, 0 );
+#else
+            if( send( id->sinkv[i].rtp_fd, out->p_buffer, len, 0 ) >= 0 )
+                continue;
 #endif
-            if( ( send( id->sinkv[i].rtp_fd, out->p_buffer, len, 0 ) < 0 )
-             && ( errno != EAGAIN ) )
-                deadv[deadc++] = id->sinkv[i].rtp_fd;
+            /* Retry sending to root out soft-errors */
+            if( send( id->sinkv[i].rtp_fd, out->p_buffer, len, 0 ) >= 0 )
+                continue;
+
+            deadv[deadc++] = id->sinkv[i].rtp_fd;
         }
         vlc_mutex_unlock( &id->lock_sink );