Changeset 567
- Timestamp:
- Jun 29, 2006 9:51:09 AM (18 years ago)
- Location:
- pjproject/trunk/pjmedia
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjmedia/include/pjmedia/rtcp.h
r537 r567 240 240 241 241 pjmedia_rtp_seq_session seq_ctrl; /**< RTCP sequence number control. */ 242 unsigned rtp_last_ts;/**< Last timestamp in RX RTP pkt. */ 242 243 243 244 unsigned clock_rate; /**< Clock rate of the stream */ -
pjproject/trunk/pjmedia/src/pjmedia/rtcp.c
r537 r567 141 141 sess->avg_jitter = 0; 142 142 143 /* Last RX timestamp in RTP packet */ 144 sess->rtp_last_ts = (unsigned)-1; 145 143 146 /* Name */ 144 147 sess->name = name ? name : THIS_FILE, … … 198 201 unsigned last_seq; 199 202 203 if (sess->stat.rx.pkt == 0) { 204 /* Init sequence for the first time. */ 205 pjmedia_rtp_seq_init(&sess->seq_ctrl, (pj_uint16_t)seq); 206 } 207 200 208 sess->stat.rx.pkt++; 201 209 sess->stat.rx.bytes += payload; 202 210 203 /* Update sequence numbers. */211 /* Process the RTP packet. */ 204 212 last_seq = sess->seq_ctrl.max_seq; 205 213 pjmedia_rtp_seq_update(&sess->seq_ctrl, (pj_uint16_t)seq, &seq_st); 214 206 215 if (seq_st.status.flag.restart) { 207 216 rtcp_init_seq(sess); … … 213 222 } 214 223 215 if (seq_st.status.flag.outorder ) {224 if (seq_st.status.flag.outorder && !seq_st.status.flag.probation) { 216 225 sess->stat.rx.reorder++; 217 226 TRACE_((sess->name, "Out-of-order packet detected")); … … 259 268 260 269 /* 261 * Calculate jitter only when sequence is good (see RFC 3550 section A.8) 270 * Calculate jitter only when sequence is good (see RFC 3550 section A.8), 271 * AND only when the timestamp is different than the last packet 272 * (see RTP FAQ). 262 273 */ 263 if (seq_st.diff == 1 ) {274 if (seq_st.diff == 1 && rtp_ts != sess->rtp_last_ts) { 264 275 /* Get arrival time and convert timestamp to samples */ 265 276 pj_get_timestamp(&ts); … … 310 321 } 311 322 } 323 324 /* Update timestamp of last RX RTP packet */ 325 sess->rtp_last_ts = rtp_ts; 312 326 } 313 327 -
pjproject/trunk/pjmedia/src/pjmedia/rtp.c
r408 r567 60 60 } 61 61 62 /* Initialize session. 63 * Initial sequence number SHOULD be random, according to RFC 3550. 64 */ 62 /* Initialize session. */ 63 pj_memset(ses, 0, sizeof(*ses)); 64 65 /* Initial sequence number SHOULD be random, according to RFC 3550. */ 65 66 ses->out_extseq = pj_rand(); 66 67 ses->peer_ssrc = 0; 67 68 68 /* Sequence number will be initialized when the first RTP packet69 * is receieved.70 */71 72 69 /* Build default header for outgoing RTP packet. */ 73 pj_memset(ses, 0, sizeof(*ses));74 70 ses->out_hdr.v = RTP_VERSION; 75 71 ses->out_hdr.p = 0;
Note: See TracChangeset
for help on using the changeset viewer.