|
|
|
@ -140,6 +140,7 @@ struct ast_frame *ast_translate(struct ast_trans_pvt *path, struct ast_frame *f,
|
|
|
|
|
p = path;
|
|
|
|
|
/* Feed the first frame into the first translator */
|
|
|
|
|
p->step->framein(p->state, f);
|
|
|
|
|
if (f->delivery.tv_sec || f->delivery.tv_usec) {
|
|
|
|
|
if (path->nextin.tv_sec || path->nextin.tv_usec) {
|
|
|
|
|
/* Make sure this is in line with what we were expecting */
|
|
|
|
|
if ((path->nextin.tv_sec != f->delivery.tv_sec) ||
|
|
|
|
@ -177,6 +178,7 @@ struct ast_frame *ast_translate(struct ast_trans_pvt *path, struct ast_frame *f,
|
|
|
|
|
path->nextin.tv_usec -= 1000000;
|
|
|
|
|
path->nextin.tv_sec++;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (consume)
|
|
|
|
|
ast_frfree(f);
|
|
|
|
|
while(p) {
|
|
|
|
@ -189,6 +191,7 @@ struct ast_frame *ast_translate(struct ast_trans_pvt *path, struct ast_frame *f,
|
|
|
|
|
if (p->next)
|
|
|
|
|
p->next->step->framein(p->next->state, out);
|
|
|
|
|
else {
|
|
|
|
|
if (f->delivery.tv_sec || f->delivery.tv_usec) {
|
|
|
|
|
/* Use next predicted outgoing timestamp */
|
|
|
|
|
out->delivery.tv_sec = path->nextout.tv_sec;
|
|
|
|
|
out->delivery.tv_usec = path->nextout.tv_usec;
|
|
|
|
@ -201,6 +204,10 @@ struct ast_frame *ast_translate(struct ast_trans_pvt *path, struct ast_frame *f,
|
|
|
|
|
path->nextout.tv_sec++;
|
|
|
|
|
path->nextout.tv_usec -= 1000000;
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
out->delivery.tv_sec = 0;
|
|
|
|
|
out->delivery.tv_usec = 0;
|
|
|
|
|
}
|
|
|
|
|
return out;
|
|
|
|
|
}
|
|
|
|
|
p = p->next;
|
|
|
|
|