[asterisk-commits] mjordan: trunk r422768 - in /trunk: ./ main/rtp_engine.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sat Sep 6 17:22:37 CDT 2014


Author: mjordan
Date: Sat Sep  6 17:22:34 2014
New Revision: 422768

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=422768
Log:
main/rtp_engine: Format NTP timestamps as unsigned ints

On some systems, a timeval's tv_sec/tv_usec will be unsigned lont ints, as
opposed to long ints. When the RTP engine formats these as strings, it was
previously formatting them as signed integers, which can result in some
odd negative timestamp values (particularly on 32-bit systems). This patch
formats the values as unsigned long integers.
........

Merged revisions 422766 from http://svn.asterisk.org/svn/asterisk/branches/12
........

Merged revisions 422767 from http://svn.asterisk.org/svn/asterisk/branches/13

Modified:
    trunk/   (props changed)
    trunk/main/rtp_engine.c

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-13-merged' - no diff available.

Modified: trunk/main/rtp_engine.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/rtp_engine.c?view=diff&rev=422768&r1=422767&r2=422768
==============================================================================
--- trunk/main/rtp_engine.c (original)
+++ trunk/main/rtp_engine.c Sat Sep  6 17:22:34 2014
@@ -1931,8 +1931,8 @@
 	if (payload->report->type == AST_RTP_RTCP_SR) {
 		char sec[32];
 		char usec[32];
-		snprintf(sec, sizeof(sec), "%ld", payload->report->sender_information.ntp_timestamp.tv_sec);
-		snprintf(usec, sizeof(usec), "%ld", payload->report->sender_information.ntp_timestamp.tv_usec);
+		snprintf(sec, sizeof(sec), "%lu", payload->report->sender_information.ntp_timestamp.tv_sec);
+		snprintf(usec, sizeof(usec), "%lu", payload->report->sender_information.ntp_timestamp.tv_usec);
 		json_rtcp_sender_info = ast_json_pack("{s: s, s: s, s: i, s: i, s: i}",
 				"ntp_timestamp_sec", sec,
 				"ntp_timestamp_usec", usec,




More information about the asterisk-commits mailing list