aboutsummaryrefslogtreecommitdiffstats
path: root/channels
diff options
context:
space:
mode:
authordvossel <dvossel@f38db490-d61c-443f-a65b-d21fe96a405b>2009-05-21 19:04:56 +0000
committerdvossel <dvossel@f38db490-d61c-443f-a65b-d21fe96a405b>2009-05-21 19:04:56 +0000
commit558f4e107838d544621a19753b7157907aee50eb (patch)
treebdbf2515d52f8c63bb40873005d3c914664f75e1 /channels
parentc18da9963e2c253afea315b844be7e563b782988 (diff)
Sign problem calculating timestamp for iax frame leads to no audio on the receiving peer.
There are rare cases in which a frame's delivery timestamp is slightly less than the iax2_pvt's offset. This causes the pvt's timestamp to be a small negative number, but since the timestamp value is unsigned it looks like a huge positive number. This patch checks for this negative case and sets the ms to zero. A similar check is already done right below this one in the 'else' statement. (closes issue #15032) Reported by: guillecabeza Patches: chan_iax2.c.patch_timestamp uploaded by guillecabeza (license 380) Tested by: guillecabeza (closes issue #14216) Reported by: Andrey Sofronov git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@195991 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rw-r--r--channels/chan_iax2.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/channels/chan_iax2.c b/channels/chan_iax2.c
index bab2c0a38..8ef2acc6f 100644
--- a/channels/chan_iax2.c
+++ b/channels/chan_iax2.c
@@ -4090,6 +4090,9 @@ static unsigned int calc_timestamp(struct chan_iax2_pvt *p, unsigned int ts, str
/* If we have a time that the frame arrived, always use it to make our timestamp */
if (delivery && !ast_tvzero(*delivery)) {
ms = ast_tvdiff_ms(*delivery, p->offset);
+ if (ms < 0) {
+ ms = 0;
+ }
if (option_debug > 2 && iaxdebug)
ast_log(LOG_DEBUG, "calc_timestamp: call %d/%d: Timestamp slaved to delivery time\n", p->callno, iaxs[p->callno]->peercallno);
} else {