From f08ce2f01d168894308cc09f317c78b23477e5b7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Fr=C3=A9d=C3=A9ric=20Perrin?= Date: Tue, 15 Dec 2020 22:51:13 +0000 Subject: [PATCH] Fix times with holes --- src/tim/prune/data/RangeStats.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/tim/prune/data/RangeStats.java b/src/tim/prune/data/RangeStats.java index d8461c4..1f57626 100644 --- a/src/tim/prune/data/RangeStats.java +++ b/src/tim/prune/data/RangeStats.java @@ -81,13 +81,10 @@ public class RangeStats if (_earliestTimestamp == null || currTstamp.isBefore(_earliestTimestamp)) { _earliestTimestamp = currTstamp; } - if (_latestTimestamp == null || currTstamp.isAfter(_latestTimestamp)) { - _latestTimestamp = currTstamp; - } // Work out duration without segment gaps - if (!inPoint.getSegmentStart() && _prevPoint != null && _prevPoint.hasTimestamp()) + if (!inPoint.getSegmentStart() && _latestTimestamp != null) { - long millisLater = currTstamp.getMillisecondsSince(_prevPoint.getTimestamp()); + long millisLater = currTstamp.getMillisecondsSince(_latestTimestamp); if (millisLater < 0) { _timesOutOfSequence = true; } @@ -95,6 +92,9 @@ public class RangeStats _movingMilliseconds += millisLater; } } + if (_latestTimestamp == null || currTstamp.isAfter(_latestTimestamp)) { + _latestTimestamp = currTstamp; + } } else { _timesIncomplete = true; -- 2.43.0