[vlc-devel] commit: Fixed deadlock when no data are received in rtp. (Laurent Aimar )
git version control
git at videolan.org
Mon Nov 24 21:31:06 CET 2008
vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Mon Nov 24 19:10:00 2008 +0100| [a34f07303469b45915a359273ff17143baa0c73d] | committer: Laurent Aimar
Fixed deadlock when no data are received in rtp.
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.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=a34f07303469b45915a359273ff17143baa0c73d
---
modules/access/rtp/input.c | 9 ++++-----
1 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/modules/access/rtp/input.c b/modules/access/rtp/input.c
index 106139d..ccd48b9 100644
--- a/modules/access/rtp/input.c
+++ b/modules/access/rtp/input.c
@@ -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);
}
+
More information about the vlc-devel
mailing list