diff options
author | etxrab <etxrab@f5534014-38df-0310-8fa8-9805f1628bb7> | 2009-06-01 16:44:05 +0000 |
---|---|---|
committer | etxrab <etxrab@f5534014-38df-0310-8fa8-9805f1628bb7> | 2009-06-01 16:44:05 +0000 |
commit | b083de563c4d27ed3b7f89d671a8696f3ae980cd (patch) | |
tree | 18e397e6bca4237c1ef314b211c3f14febcf4c53 /tap-rtp-common.c | |
parent | 75c2fbb0495c54987ce263eb66bb85b02edf4c52 (diff) |
Show max and mean Jitter.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@28560 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'tap-rtp-common.c')
-rw-r--r-- | tap-rtp-common.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/tap-rtp-common.c b/tap-rtp-common.c index 76db0e1cda..b8d8a60825 100644 --- a/tap-rtp-common.c +++ b/tap-rtp-common.c @@ -438,9 +438,11 @@ int rtp_packet_analyse(tap_rtp_stat_t *statinfo, double current_time; double current_jitter; double current_diff; + double expected_time; guint32 clock_rate; statinfo->flags = 0; + /* check payload type */ if (rtpinfo->info_payload_type == PT_CN || rtpinfo->info_payload_type == PT_CN_OLD) @@ -467,8 +469,11 @@ int rtp_packet_analyse(tap_rtp_stat_t *statinfo, /* Store the current time and calculate the current jitter(in ms) */ current_time = nstime_to_msec(&pinfo->fd->rel_ts); - current_diff = fabs (current_time - (statinfo->time) - ((double)(rtpinfo->info_timestamp)-(double)(statinfo->timestamp))/(clock_rate*1000)); - current_jitter = statinfo->jitter + ( current_diff - statinfo->jitter)/16; + /* Expected time is last arrival time + the timestamp difference divided by the sampling clock( /1000 to get ms) */ + expected_time = statinfo->time + ((double)(rtpinfo->info_timestamp)-(double)(statinfo->timestamp))/(clock_rate/1000); + current_diff = fabs(current_time - expected_time); + current_jitter = (15 * statinfo->jitter + current_diff) / 16; + statinfo->delta = current_time-(statinfo->time); statinfo->jitter = current_jitter; statinfo->diff = current_diff; |