struct private_ortp_recv_data *pord = rn->private_data;
struct timeval tmp;
- if (tv_diff(&s->now, &pord->next_chunk, &tmp) >= 0) {
+ if (tv_diff(now, &pord->next_chunk, &tmp) >= 0) {
tmp.tv_sec = 0;
tmp.tv_usec = 1000;
}
pord->next_chunk.tv_usec);
}
-static void ortp_recv_post_select(struct sched *s, struct task *t)
+static void ortp_recv_post_select(__a_unused struct sched *s, struct task *t)
{
struct receiver_node *rn = t->private_data;
struct private_ortp_recv_data *pord = rn->private_data;
unsigned chunk_time;
// PARA_INFO_LOG("rn: %p, pord: %p, session: %p\n", rn, pord, pord->session);
+ t->ret = -E_ORTP_RECV_EOF;
+ if (rn->output_eof && *rn->output_eof) {
+ rn->eof = 1;
+ return;
+ }
t->ret = 1;
if (pord->start.tv_sec)
- if (tv_diff(&s->now, &pord->next_chunk, NULL) < 0)
+ if (tv_diff(now, &pord->next_chunk, NULL) < 0)
return;
mp = rtp_session_recvm_with_ts(pord->session, pord->timestamp);
if (!mp) {
if ((pord->c_bad > 5000 && pord->start.tv_sec) || pord->c_bad > 10000)
return;
t->ret = 1;
- tv_add(&s->now, &min_delay, &pord->next_chunk);
+ tv_add(now, &min_delay, &pord->next_chunk);
return;
}
/* okay, we have a chunk of data */
if (!pord->start.tv_sec)
- pord->start = s->now;
+ pord->start = *now;
t->ret = msg_to_buf(mp, tmpbuf, CHUNK_SIZE);
if (t->ret < ORTP_AUDIO_HEADER_LEN) {
rn->eof = 1;
freemsg(mp);
if (pord->c_bad) {
pord->c_bad = 0;
- pord->next_chunk = s->now;
+ pord->next_chunk = *now;
}
compute_next_chunk(chunk_time, pord);
return;