From: David Vossel Date: Thu, 21 May 2009 19:13:45 +0000 (+0000) Subject: Merged revisions 195995 via svnmerge from X-Git-Tag: 1.6.1.3-rc1~218 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=456242c645fc8a0e946ec6553a314e8324837de6;p=thirdparty%2Fasterisk.git Merged revisions 195995 via svnmerge from https://origsvn.digium.com/svn/asterisk/trunk ................ r195995 | dvossel | 2009-05-21 14:11:49 -0500 (Thu, 21 May 2009) | 20 lines Merged revisions 195991 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r195991 | dvossel | 2009-05-21 14:04:56 -0500 (Thu, 21 May 2009) | 14 lines 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: https://origsvn.digium.com/svn/asterisk/branches/1.6.1@195998 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/channels/chan_iax2.c b/channels/chan_iax2.c index 3b0e59493c..be5e107b6f 100644 --- a/channels/chan_iax2.c +++ b/channels/chan_iax2.c @@ -4522,6 +4522,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 (iaxdebug) ast_debug(3, "calc_timestamp: call %d/%d: Timestamp slaved to delivery time\n", p->callno, iaxs[p->callno]->peercallno); } else {