diff options
author | Anders Broman <anders.broman@ericsson.com> | 2009-05-31 17:06:04 +0000 |
---|---|---|
committer | Anders Broman <anders.broman@ericsson.com> | 2009-05-31 17:06:04 +0000 |
commit | 5ed6a83dff59b23e7ec2574fca6513ac78f683c4 (patch) | |
tree | a546e0fdd71c2ec768ae7e3a15d36052377bf0af /tap-rtp-common.c | |
parent | 3e0d2b270779f78e2997f5517d19c212ceeb9a66 (diff) | |
download | wireshark-5ed6a83dff59b23e7ec2574fca6513ac78f683c4.tar.gz wireshark-5ed6a83dff59b23e7ec2574fca6513ac78f683c4.tar.bz2 wireshark-5ed6a83dff59b23e7ec2574fca6513ac78f683c4.zip |
Calculate jitter and delta in ms.
svn path=/trunk/; revision=28546
Diffstat (limited to 'tap-rtp-common.c')
-rw-r--r-- | tap-rtp-common.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tap-rtp-common.c b/tap-rtp-common.c index b90725adf7..76db0e1cda 100644 --- a/tap-rtp-common.c +++ b/tap-rtp-common.c @@ -465,9 +465,9 @@ int rtp_packet_analyse(tap_rtp_stat_t *statinfo, clock_rate = 1; } - /* store the current time and calculate the current jitter */ - current_time = nstime_to_sec(&pinfo->fd->rel_ts); - current_diff = fabs (current_time - (statinfo->time) - ((double)(rtpinfo->info_timestamp)-(double)(statinfo->timestamp))/clock_rate); + /* 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; statinfo->delta = current_time-(statinfo->time); statinfo->jitter = current_jitter; @@ -477,7 +477,7 @@ int rtp_packet_analyse(tap_rtp_stat_t *statinfo, statinfo->bw_history[statinfo->bw_index].bytes = rtpinfo->info_data_len + 28; statinfo->bw_history[statinfo->bw_index].time = current_time; /* check if there are more than 1sec in the history buffer to calculate BW in bps. If so, remove those for the calculation */ - while ((statinfo->bw_history[statinfo->bw_start_index].time+1)<current_time){ + while ((statinfo->bw_history[statinfo->bw_start_index].time+1000/* ms */)<current_time){ statinfo->total_bytes -= statinfo->bw_history[statinfo->bw_start_index].bytes; statinfo->bw_start_index++; if (statinfo->bw_start_index == BUFF_BW) statinfo->bw_start_index=0; |