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.
This commit is contained in:
William Charlton 2020-07-25 21:03:19 +01:00 committed by GitHub
parent a776c49ade
commit aa11042839
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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)