[asterisk-commits] dvossel: branch 1.4 r195991 - /branches/1.4/channels/chan_iax2.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu May 21 14:05:03 CDT 2009


Author: dvossel
Date: Thu May 21 14:04:56 2009
New Revision: 195991

URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=195991
Log:
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


Modified:
    branches/1.4/channels/chan_iax2.c

Modified: branches/1.4/channels/chan_iax2.c
URL: http://svn.asterisk.org/svn-view/asterisk/branches/1.4/channels/chan_iax2.c?view=diff&rev=195991&r1=195990&r2=195991
==============================================================================
--- branches/1.4/channels/chan_iax2.c (original)
+++ branches/1.4/channels/chan_iax2.c Thu May 21 14:04:56 2009
@@ -4090,6 +4090,9 @@
 	/* 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 {




More information about the asterisk-commits mailing list