aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2007-02-07 17:39:31 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2007-02-07 17:39:31 +0000
commit42125ca542d7940ceaf81730aca6410018950177 (patch)
treece8b7f4d049d852321d0a5604239c4a33dc0eb4f
parent315bf5b3e314f3ce90af814fbc15da88cd4c0078 (diff)
When parsing the NTP timestamp in a sender report message, you are supposed to
take the low 16 bits of the integer part, and the high 16 bits of the fractional part. However, the code here was erroneously taking the low 16 bits of the fractional part. It then shifted the result 16 bits down, so the result was always zero. This fix makes it grab the appropriate high 16 bits, instead. (issue #8991, pointed out by andre_abrantes) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@53429 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--main/rtp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/main/rtp.c b/main/rtp.c
index 394bd4aeb..78349f236 100644
--- a/main/rtp.c
+++ b/main/rtp.c
@@ -898,7 +898,7 @@ struct ast_frame *ast_rtcp_read(struct ast_rtp *rtp)
gettimeofday(&rtp->rtcp->rxlsr,NULL); /* To be able to populate the dlsr */
rtp->rtcp->spc = ntohl(rtcpheader[i+3]);
rtp->rtcp->soc = ntohl(rtcpheader[i + 4]);
- rtp->rtcp->themrxlsr = ((ntohl(rtcpheader[i]) & 0x0000ffff) << 16) | ((ntohl(rtcpheader[i + 1]) & 0xffff) >> 16); /* Going to LSR in RR*/
+ rtp->rtcp->themrxlsr = ((ntohl(rtcpheader[i]) & 0x0000ffff) << 16) | ((ntohl(rtcpheader[i + 1]) & 0xffff0000) >> 16); /* Going to LSR in RR*/
if (rtcp_debug_test_addr(&sin)) {
ast_verbose("NTP timestamp: %lu.%010lu\n", (unsigned long) ntohl(rtcpheader[i]), (unsigned long) ntohl(rtcpheader[i + 1]) * 4096);