Commit 03d82d1d authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Small race condition

parent a2b79dee
...@@ -203,6 +203,7 @@ int rtp_process (demux_t *demux) ...@@ -203,6 +203,7 @@ int rtp_process (demux_t *demux)
{ {
demux_sys_t *p_sys = demux->p_sys; demux_sys_t *p_sys = demux->p_sys;
mtime_t deadline = INT64_MAX; mtime_t deadline = INT64_MAX;
int ret;
vlc_mutex_lock (&p_sys->lock); vlc_mutex_lock (&p_sys->lock);
if (rtp_dequeue (demux, p_sys->session, &deadline)) if (rtp_dequeue (demux, p_sys->session, &deadline))
...@@ -210,7 +211,8 @@ int rtp_process (demux_t *demux) ...@@ -210,7 +211,8 @@ int rtp_process (demux_t *demux)
vlc_cond_timedwait (&p_sys->wait, &p_sys->lock, deadline); vlc_cond_timedwait (&p_sys->wait, &p_sys->lock, deadline);
else else
vlc_cond_wait (&p_sys->wait, &p_sys->lock); vlc_cond_wait (&p_sys->wait, &p_sys->lock);
ret = p_sys->dead ? -1 : 0;
vlc_mutex_unlock (&p_sys->lock); vlc_mutex_unlock (&p_sys->lock);
return p_sys->dead ? -1 : 0; return ret;
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment