From aa11042839ea7e850f665f0d4b908ce85bc8067a Mon Sep 17 00:00:00 2001 From: William Charlton <38622599+willwill2will54@users.noreply.github.com> Date: Sat, 25 Jul 2020 21:03:19 +0100 Subject: [PATCH] Fixes error with slow mode on low FPS When frame_time exceeds 0.5 this change caps the sleep time to be at least zero, as trying to sleep a negative duration crashes the program. --- src/cli/test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cli/test.py b/src/cli/test.py index 21cb2db..dbcd06d 100644 --- a/src/cli/test.py +++ b/src/cli/test.py @@ -183,7 +183,7 @@ try: # Delay the frame if slowmode is on if slow_mode: - time.sleep(.5 - frame_time) + time.sleep(max([.5 - frame_time, 0.0])) if exposure != -1: # For a strange reason on some cameras (e.g. Lenoxo X1E)