mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-06 12:36:58 +00:00
Don't translate time for packets with no delivery
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@2631 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -140,6 +140,7 @@ struct ast_frame *ast_translate(struct ast_trans_pvt *path, struct ast_frame *f,
|
|||||||
p = path;
|
p = path;
|
||||||
/* Feed the first frame into the first translator */
|
/* Feed the first frame into the first translator */
|
||||||
p->step->framein(p->state, f);
|
p->step->framein(p->state, f);
|
||||||
|
if (f->delivery.tv_sec || f->delivery.tv_usec) {
|
||||||
if (path->nextin.tv_sec || path->nextin.tv_usec) {
|
if (path->nextin.tv_sec || path->nextin.tv_usec) {
|
||||||
/* Make sure this is in line with what we were expecting */
|
/* Make sure this is in line with what we were expecting */
|
||||||
if ((path->nextin.tv_sec != f->delivery.tv_sec) ||
|
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_usec -= 1000000;
|
||||||
path->nextin.tv_sec++;
|
path->nextin.tv_sec++;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (consume)
|
if (consume)
|
||||||
ast_frfree(f);
|
ast_frfree(f);
|
||||||
while(p) {
|
while(p) {
|
||||||
@@ -189,6 +191,7 @@ struct ast_frame *ast_translate(struct ast_trans_pvt *path, struct ast_frame *f,
|
|||||||
if (p->next)
|
if (p->next)
|
||||||
p->next->step->framein(p->next->state, out);
|
p->next->step->framein(p->next->state, out);
|
||||||
else {
|
else {
|
||||||
|
if (f->delivery.tv_sec || f->delivery.tv_usec) {
|
||||||
/* Use next predicted outgoing timestamp */
|
/* Use next predicted outgoing timestamp */
|
||||||
out->delivery.tv_sec = path->nextout.tv_sec;
|
out->delivery.tv_sec = path->nextout.tv_sec;
|
||||||
out->delivery.tv_usec = path->nextout.tv_usec;
|
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_sec++;
|
||||||
path->nextout.tv_usec -= 1000000;
|
path->nextout.tv_usec -= 1000000;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
out->delivery.tv_sec = 0;
|
||||||
|
out->delivery.tv_usec = 0;
|
||||||
|
}
|
||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
p = p->next;
|
p = p->next;
|
||||||
|
Reference in New Issue
Block a user