Adjust time stamps even if the secs value of the time stamp is 0.
authorGuy Harris <guy@alum.mit.edu>
Fri, 12 Feb 2016 02:13:15 +0000 (18:13 -0800)
committerGuy Harris <guy@alum.mit.edu>
Fri, 12 Feb 2016 02:13:53 +0000 (02:13 +0000)
If the seconds value in a time stamp is 0, that says nothing whatsoever
about whether it's supported or not - it's the presence flag, which
we've already tested and found to be set, that indicates whether the
time stamp is supported.

Bug: 12116
Change-Id: I91354783af7b6356d9806c7559d35da44ea4567f
Reviewed-on: https://code.wireshark.org/review/13913
Reviewed-by: Guy Harris <guy@alum.mit.edu>
editcap.c

index 47d954265f4616540864135b0c243b6405ee10f1..2cd4a1ceb88687ef89e28c8659fd99f6fb399701 100644 (file)
--- a/editcap.c
+++ b/editcap.c
@@ -1562,9 +1562,7 @@ main(int argc, char *argv[])
                         previous_time = phdr->ts;
                     }
 
-                    /* assume that if the frame's tv_sec is 0, then
-                     * the timestamp isn't supported */
-                    if (phdr->ts.secs > 0 && time_adj.tv.secs != 0) {
+                    if (time_adj.tv.secs != 0) {
                         temp_phdr = *phdr;
                         if (time_adj.is_negative)
                             temp_phdr.ts.secs -= time_adj.tv.secs;
@@ -1573,9 +1571,7 @@ main(int argc, char *argv[])
                         phdr = &temp_phdr;
                     }
 
-                    /* assume that if the frame's tv_sec is 0, then
-                     * the timestamp isn't supported */
-                    if (phdr->ts.secs > 0 && time_adj.tv.nsecs != 0) {
+                    if (time_adj.tv.nsecs != 0) {
                         temp_phdr = *phdr;
                         if (time_adj.is_negative) { /* subtract */
                             if (temp_phdr.ts.nsecs < time_adj.tv.nsecs) { /* borrow */