Calculate jitter and delta in ms.
authoretxrab <etxrab@f5534014-38df-0310-8fa8-9805f1628bb7>
Sun, 31 May 2009 17:06:04 +0000 (17:06 +0000)
committeretxrab <etxrab@f5534014-38df-0310-8fa8-9805f1628bb7>
Sun, 31 May 2009 17:06:04 +0000 (17:06 +0000)
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@28546 f5534014-38df-0310-8fa8-9805f1628bb7

gtk/rtp_analysis.c
tap-rtp-common.c
tap-rtp.c

index 8edfc1040e580beeaa86ca1e75e5bfce08e1c442..ab63be1be5e8c945eb71b7b0d713b40deb967530 100644 (file)
@@ -592,8 +592,8 @@ static int rtp_packet_add_info(GtkWidget *list, user_data_t * user_data,
        else {
                add_to_list(list, user_data,
                        pinfo->fd->num, rtpinfo->info_seq_num,
-                       statinfo->delta*1000,
-                       statinfo->jitter*1000,
+                       statinfo->delta,
+                       statinfo->jitter,
                        statinfo->bandwidth,
                        status,
                        rtpinfo->info_marker_set,
@@ -2826,21 +2826,21 @@ static void draw_stat(user_data_t *user_data)
                 r_perc = 0;
         }
 
-       g_snprintf(label_max, sizeof(label_max), "Max delta = %f sec at packet no. %u \n"
+       g_snprintf(label_max, sizeof(label_max), "Max delta = %f ms at packet no. %u \n"
                "Total RTP packets = %u   (expected %u)   Lost RTP packets = %d (%.2f%%)"
                "   Sequence errors = %u",
                user_data->forward.statinfo.max_delta, user_data->forward.statinfo.max_nr,
-               user_data->forward.statinfo.total_nr,
-               f_expected, f_lost, f_perc, user_data->forward.statinfo.sequence);
+               user_data->forward.statinfo.total_nr, f_expected, f_lost, f_perc, 
+               user_data->forward.statinfo.sequence);
 
        gtk_label_set_text(GTK_LABEL(user_data->dlg.label_stats_fwd), label_max);
 
-       g_snprintf(label_max, sizeof(label_max), "Max delta = %f sec at packet no. %u \n"
+       g_snprintf(label_max, sizeof(label_max), "Max delta = %f ms at packet no. %u \n"
                "Total RTP packets = %u   (expected %u)   Lost RTP packets = %d (%.2f%%)"
                "   Sequence errors = %u",
                user_data->reversed.statinfo.max_delta, user_data->reversed.statinfo.max_nr,
-               user_data->reversed.statinfo.total_nr,
-               r_expected, r_lost, r_perc, user_data->reversed.statinfo.sequence);
+               user_data->reversed.statinfo.total_nr, r_expected, r_lost, r_perc, 
+               user_data->reversed.statinfo.sequence);
 
        gtk_label_set_text(GTK_LABEL(user_data->dlg.label_stats_rev), label_max);
 
index b90725adf7eb9ca88174322e0f4c23999772059a..76db0e1cda0b197382ec245cd70447c25382408f 100644 (file)
@@ -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;
index 6823d4198e32cab3343572e7583fc0f6c331d920..a9b1f6a864946cc98d8cbe4128c30d70b259a423 100644 (file)
--- a/tap-rtp.c
+++ b/tap-rtp.c
@@ -120,9 +120,9 @@ rtp_streams_stat_draw(void *arg _U_)
            payload_type,
            strinfo->npackets,
            lost, perc,
-           strinfo->rtp_stats.max_delta*1000,
-           strinfo->rtp_stats.max_jitter*1000,
-           strinfo->rtp_stats.mean_jitter*1000,
+           strinfo->rtp_stats.max_delta,
+           strinfo->rtp_stats.max_jitter,
+           strinfo->rtp_stats.mean_jitter,
            (strinfo->problem)?"X":"");
         
        list = g_list_next(list);