From ba8ab554fd1418f7371ed78b3f3428fcbc39bfc8 Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Wed, 4 Mar 2015 20:14:39 +0100 Subject: [PATCH] RTP: fixed UDP multithreaded receiving --- src/rtp/net_udp.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/rtp/net_udp.c b/src/rtp/net_udp.c index ab5f6e32d..d68e27a9e 100644 --- a/src/rtp/net_udp.c +++ b/src/rtp/net_udp.c @@ -1258,6 +1258,10 @@ bool udp_not_empty(socket_udp * s, struct timeval *timeout) while (rc == 0 && s->queue_head == s->queue_tail) { rc = pthread_cond_timedwait(&s->boss_cv, &s->lock, &ts); } + } else { + while (s->queue_head == s->queue_tail) { + rc = pthread_cond_timedwait(&s->boss_cv, &s->lock); + } } ret = (s->queue_head != s->queue_tail); pthread_mutex_unlock(&s->lock);