Another attempt at bug 4669: Properly set the previous-displayed-packet
authorgerald <gerald@f5534014-38df-0310-8fa8-9805f1628bb7>
Wed, 26 May 2010 23:29:56 +0000 (23:29 +0000)
committergerald <gerald@f5534014-38df-0310-8fa8-9805f1628bb7>
Wed, 26 May 2010 23:29:56 +0000 (23:29 +0000)
timestamp when we're recalculating reference times.

Remove an unused variable. Add whitespace & comment fixups.

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@32985 f5534014-38df-0310-8fa8-9805f1628bb7

file.c

diff --git a/file.c b/file.c
index eb31d54588f7f59c34d01896f7273a9ddba111e8..f7395b4c2e76a4dff40218dfb99048b3b9ae9020 100644 (file)
--- a/file.c
+++ b/file.c
@@ -2354,13 +2354,16 @@ ref_time_packets(capture_file *cf)
 
   nstime_set_unset(&first_ts);
   nstime_set_unset(&prev_dis_ts);
-  nstime_set_unset(&prev_cap_ts);
   cum_bytes = 0;
 
   for (fdata = cf->plist_start; fdata != NULL; fdata = fdata->next) {
     /* just add some value here until we know if it is being displayed or not */
     fdata->cum_bytes = cum_bytes + fdata->pkt_len;
 
+    /*
+     *Timestamps
+     */
+
     /* If we don't have the time stamp of the first packet in the
      capture, it's because this is the first packet.  Save the time
      stamp of this packet as the time stamp of the first packet. */
@@ -2370,7 +2373,7 @@ ref_time_packets(capture_file *cf)
       /* if this frames is marked as a reference time frame, reset
         firstsec and firstusec to this frame */
     if(fdata->flags.ref_time){
-    first_ts = fdata->abs_ts;
+        first_ts = fdata->abs_ts;
     }
 
     /* If we don't have the time stamp of the previous displayed packet,
@@ -2396,12 +2399,17 @@ ref_time_packets(capture_file *cf)
      this packet. */
     nstime_delta(&fdata->del_dis_ts, &fdata->abs_ts, &prev_dis_ts);
 
+    prev_dis_ts = fdata->abs_ts;
+
+    /*
+     * Byte counts
+     */
     if( (fdata->flags.passed_dfilter) || (fdata->flags.ref_time) ){
         /* This frame either passed the display filter list or is marked as
         a time reference frame.  All time reference frames are displayed
         even if they dont pass the display filter */
         if(fdata->flags.ref_time){
-            /* if this was a TIME REF frame we should reset the cubytes field */
+            /* if this was a TIME REF frame we should reset the cum_bytes field */
             cum_bytes = fdata->pkt_len;
             fdata->cum_bytes =  cum_bytes;
         } else {