mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-09 00:00:00 +01:00
prevent rtp_read from returning when queue is empty
This commit is contained in:
parent
9216b1fbd6
commit
e1adfa9247
1 changed files with 6 additions and 5 deletions
|
@ -468,18 +468,19 @@ int rtp_type_stop()
|
|||
|
||||
int rtp_read(struct node *n, struct sample *smps[], unsigned cnt, unsigned *release)
|
||||
{
|
||||
int ret;
|
||||
int ret = 0;
|
||||
struct rtp *r = (struct rtp *) n->_vd;
|
||||
size_t bytes;
|
||||
char *buf;
|
||||
struct mbuf *mb;
|
||||
|
||||
/* Get data from queue */
|
||||
ret = queue_signalled_pull(&r->recv_queue, (void **) &mb);
|
||||
if (ret <= 0) {
|
||||
if (ret < 0)
|
||||
while (ret == 0) {
|
||||
ret = queue_signalled_pull(&r->recv_queue, (void **) &mb);
|
||||
if (ret < 0) {
|
||||
warning("Failed to pull from queue");
|
||||
return ret;
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
/* Read from mbuf */
|
||||
|
|
Loading…
Add table
Reference in a new issue