From 3f32b040dceb8150de469b50e585e45eb7ff180a Mon Sep 17 00:00:00 2001 From: jagannatharjun Date: Wed, 7 Apr 2021 22:43:36 +0530 Subject: [PATCH] Revert "Change clamping of update interval of SpeedPlotView::Averager" This reverts commit 435bb3443507dd224b3579dbb4ba5657dc5cc8fa. To achieve what the reverted commit wants, the timing would need to be taken iteratively rather that cumulatively fixes #14735 --- src/gui/properties/speedplotview.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gui/properties/speedplotview.cpp b/src/gui/properties/speedplotview.cpp index 4589eba94..2d53c1fe2 100644 --- a/src/gui/properties/speedplotview.cpp +++ b/src/gui/properties/speedplotview.cpp @@ -120,7 +120,8 @@ bool SpeedPlotView::Averager::push(const SampleData &sampleData) // system may go to sleep, that can cause very big elapsed interval const milliseconds updateInterval {static_cast(BitTorrent::Session::instance()->refreshInterval() * 1.25)}; - const milliseconds elapsed {std::min(milliseconds {m_lastSampleTime.elapsed()}, updateInterval)}; + const milliseconds maxElapsed {std::max(updateInterval, m_resolution)}; + const milliseconds elapsed {std::min(milliseconds {m_lastSampleTime.elapsed()}, maxElapsed)}; if (elapsed < m_resolution) return false; // still accumulating