From 9ef1c02adea70a46c91503e2c0c960262280ba24 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Fri, 12 Oct 2018 19:03:02 +0200 Subject: tracker/pipeline: try help frame variance While we're keeping 250 Hz in the tracker pipeline, the frame variance isn't optimal, as per `backlog_time' values. Try a different magic number. --- logic/pipeline.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'logic') diff --git a/logic/pipeline.cpp b/logic/pipeline.cpp index 6a01b272..021a576b 100644 --- a/logic/pipeline.cpp +++ b/logic/pipeline.cpp @@ -588,8 +588,10 @@ void pipeline::run() backlog_time += ns{elapsed_nsecs - const_sleep_ms}; - const int sleep_time_ms = ms{clamp(const_sleep_ms - backlog_time, - ms{}, ms{10})}.count() + .1f; + const int sleep_time_ms = (int)( + clamp(ms{const_sleep_ms - backlog_time}, + ms{0}, ms{10}).count() - .45f + ); #ifdef DEBUG_TIMINGS { -- cgit v1.2.3