]> git.sesse.net Git - vlc/commitdiff
Fixed deadlock when no data are received in rtp.
authorLaurent Aimar <fenrir@videolan.org>
Mon, 24 Nov 2008 18:10:00 +0000 (19:10 +0100)
committerLaurent Aimar <fenrir@videolan.org>
Mon, 24 Nov 2008 18:13:09 +0000 (19:13 +0100)
 It might not be the cleanest way, but I don't see any other fix with the
current API.
 Feel free to revert if a better fix can be found.

modules/access/rtp/input.c

index 106139de4a18341c09b173a10c37b27b08c24bd4..ccd48b9338e2f411e6cd8af6c70d8e66b8b11327 100644 (file)
@@ -199,10 +199,9 @@ void rtp_process (demux_t *demux)
     mtime_t deadline;
 
     vlc_mutex_lock (&p_sys->lock);
-    if (rtp_dequeue (demux, p_sys->session, &deadline))
-        /* Pace the demux thread */
-        vlc_cond_timedwait (&p_sys->wait, &p_sys->lock, deadline);
-    else
-        vlc_cond_wait (&p_sys->wait, &p_sys->lock);
+    if (!rtp_dequeue (demux, p_sys->session, &deadline))
+        deadline = mdate () + CLOCK_FREQ / 5;
+    vlc_cond_timedwait (&p_sys->wait, &p_sys->lock, deadline);
     vlc_mutex_unlock (&p_sys->lock);
 }
+