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 106139d..ccd48b9 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);
 }
+