提交 2bf9878c authored 作者: Dragos Oancea's avatar Dragos Oancea

FS-11599: [core] fix inter-arrival jitter (timer)

上级 eb37939b
...@@ -1933,7 +1933,7 @@ static int rtcp_stats(switch_rtp_t *rtp_session) ...@@ -1933,7 +1933,7 @@ static int rtcp_stats(switch_rtp_t *rtp_session)
if (pkt_seq < max_seq) { if (pkt_seq < max_seq) {
stats->cycle++; stats->cycle++;
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "rtcp_stats:[cycle change] pkt_seq[%d] cycle[%d] max_seq[%d] stats_ssrc[%u] local_ts[%u]\n", switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "rtcp_stats:[cycle change] pkt_seq[%d] cycle[%d] max_seq[%d] stats_ssrc[%u] local_ts[%u]\n",
pkt_seq, stats->cycle, max_seq, stats->ssrc, rtp_session->write_timer.samplecount); pkt_seq, stats->cycle, max_seq, stats->ssrc, rtp_session->timer.samplecount);
} }
pkt_extended_seq = stats->cycle << 16 | pkt_seq; /* getting the extended packet extended sequence ID */ pkt_extended_seq = stats->cycle << 16 | pkt_seq; /* getting the extended packet extended sequence ID */
if (pkt_extended_seq > stats->high_ext_seq_recv) { if (pkt_extended_seq > stats->high_ext_seq_recv) {
...@@ -1963,7 +1963,7 @@ static int rtcp_stats(switch_rtp_t *rtp_session) ...@@ -1963,7 +1963,7 @@ static int rtcp_stats(switch_rtp_t *rtp_session)
stats->period_pkt_count, pkt_seq, stats->cycle, stats->ssrc, rtp_session->write_timer.samplecount); stats->period_pkt_count, pkt_seq, stats->cycle, stats->ssrc, rtp_session->write_timer.samplecount);
#endif #endif
/* Interarrival jitter calculation */ /* Interarrival jitter calculation */
pkt_tsdiff = abs((int32_t)(rtp_session->write_timer.samplecount - ntohl(hdr->ts))); /* relative transit times for this packet */ pkt_tsdiff = abs((int32_t)(rtp_session->timer.samplecount - ntohl(hdr->ts))); /* relative transit times for this packet */
if (stats->pkt_count < 2) { /* Can not compute Jitter with only one packet */ if (stats->pkt_count < 2) { /* Can not compute Jitter with only one packet */
stats->last_pkt_tsdiff = pkt_tsdiff; stats->last_pkt_tsdiff = pkt_tsdiff;
} else { } else {
...@@ -1976,7 +1976,7 @@ static int rtcp_stats(switch_rtp_t *rtp_session) ...@@ -1976,7 +1976,7 @@ static int rtcp_stats(switch_rtp_t *rtp_session)
#ifdef DEBUG_RTCP #ifdef DEBUG_RTCP
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG10, "rtcp_stats: pkt_ts[%d]local_ts[%d]diff[%d]pkt_spacing[%d]inter_jitter[%f]seq[%d]stats_ssrc[%d]", switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG10, "rtcp_stats: pkt_ts[%d]local_ts[%d]diff[%d]pkt_spacing[%d]inter_jitter[%f]seq[%d]stats_ssrc[%d]",
ntohl(hdr->ts), rtp_session->write_timer.samplecount, pkt_tsdiff, packet_spacing_diff, stats->inter_jitter, ntohs(hdr->seq), stats->ssrc); ntohl(hdr->ts), rtp_session->timer.samplecount, pkt_tsdiff, packet_spacing_diff, stats->inter_jitter, ntohs(hdr->seq), stats->ssrc);
#endif #endif
return 1; return 1;
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论