Changeset 388 for pjproject/trunk
- Timestamp:
- Apr 5, 2006 7:08:16 PM (19 years ago)
- Location:
- pjproject/trunk
- Files:
-
- 2 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 -
pjproject/trunk/pjsip-apps/src/samples/siprtp.c
r384 r388 176 176 pj_status_t status); 177 177 178 178 /* Print call */ 179 static void print_call(int call_index); 179 180 180 181 … … 676 677 pj_time_val null_time = {0, 0}; 677 678 679 PJ_LOG(3,(THIS_FILE, "Call #%d disconnected. Reason=%s", 680 call->index, 681 pjsip_get_status_text(inv->cause)->ptr)); 682 PJ_LOG(3,(THIS_FILE, "Call #%d statistics:", call->index)); 683 print_call(call->index); 684 685 678 686 call->inv = NULL; 679 687 inv->mod_data[mod_siprtp.id] = NULL; … … 685 693 call->connect_time = null_time; 686 694 687 PJ_LOG(3,(THIS_FILE, "Call #%d disconnected. Reason=%s",688 call->index,689 pjsip_get_status_text(inv->cause)->ptr));690 695 691 696 } else if (inv->state == PJSIP_INV_STATE_CONFIRMED) { … … 1472 1477 1473 1478 1474 if (call-> media[0].thread == NULL) {1479 if (call->inv == NULL || call->inv->state < PJSIP_INV_STATE_CONFIRMED) { 1475 1480 return; 1476 1481 }
Note: See TracChangeset
for help on using the changeset viewer.