Changeset 388 for pjproject/trunk/pjmedia/src/pjmedia/rtcp.c
- Timestamp:
- Apr 5, 2006 7:08:16 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjmedia/src/pjmedia/rtcp.c
r385 r388 38 38 # define TRACE_(x) PJ_LOG(3,x) 39 39 #else 40 # define TRACE_(x) 40 # define TRACE_(x) ; 41 41 #endif 42 42 … … 190 190 pj_get_timestamp(&session->rx_lsr_time); 191 191 192 TRACE_((THIS_FILE, "Rx RTCP SR: ntp-ts=%p, time=%p", 193 session->rx_lsr, 194 (pj_uint32_t)(session->rx_lsr_time.u64*65536/session->ts_freq.u64))); 195 192 196 /* Calculate RTT if it has RR */ 193 197 if (size >= sizeof(pjmedia_rtcp_pkt)) { … … 221 225 eedelay = (eedelay * 1000000) >> 16; 222 226 223 TRACE_((THIS_FILE, "Rx RTCP : lsr=%p, dlsr=%p (%d:%03dms), "227 TRACE_((THIS_FILE, "Rx RTCP RR: lsr=%p, dlsr=%p (%d:%03dms), " 224 228 "now=%p, rtt=%p", 225 229 lsr, dlsr, dlsr/65536, (dlsr%65536)*1000/65536, … … 232 236 session->rtt_us = (pj_uint32_t)eedelay; 233 237 } else { 234 TRACE_((THIS_FILE, "NTP clock running backwards?"));238 PJ_LOG(3, (THIS_FILE, "Internal NTP clock skew detected")); 235 239 } 236 240 } … … 302 306 pj_uint32_t lsr = session->rx_lsr; 303 307 pj_uint64_t lsr_time = session->rx_lsr_time.u64; 304 308 pj_uint32_t dlsr; 309 310 /* Convert LSR time to 1/65536 seconds resolution */ 311 lsr_time = (lsr_time << 16) / session->ts_freq.u64; 312 305 313 /* Fill in LSR. 306 314 LSR is the middle 32bit of the last SR NTP time received. … … 314 322 315 323 /* Convert interval to 1/65536 seconds value */ 316 ts.u64 = ((ts.u64 - lsr_time) << 16) / session->ts_freq.u64; 317 318 rtcp_pkt->rr.dlsr = pj_htonl( (pj_uint32_t)ts.u64 ); 324 ts.u64 = (ts.u64 << 16) / session->ts_freq.u64; 325 326 /* Get DLSR */ 327 dlsr = (pj_uint32_t)(ts.u64 - lsr_time); 328 rtcp_pkt->rr.dlsr = pj_htonl(dlsr); 329 330 TRACE_((THIS_FILE, "Tx RTCP RR: lsr=%p, lsr_time=%p, now=%p, dlsr=%p" 331 "(%ds:%03dms)", 332 lsr, 333 (pj_uint32_t)lsr_time, 334 (pj_uint32_t)ts.u64, 335 dlsr, 336 dlsr/65536, 337 (dlsr%65536)*1000/65536 )); 319 338 } 320 339
Note: See TracChangeset
for help on using the changeset viewer.