From 92dc4a0849ae03f2461c30f8464a1a888cb900cf Mon Sep 17 00:00:00 2001 From: dragonpilot Date: Tue, 17 Mar 2020 12:22:34 +1000 Subject: [PATCH] dashcamd sleep time should be more than 0 secs --- selfdrive/dragonpilot/dashcamd/dashcamd.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/selfdrive/dragonpilot/dashcamd/dashcamd.py b/selfdrive/dragonpilot/dashcamd/dashcamd.py index 78aa49af1..7694a665b 100644 --- a/selfdrive/dragonpilot/dashcamd/dashcamd.py +++ b/selfdrive/dragonpilot/dashcamd/dashcamd.py @@ -56,10 +56,12 @@ def main(gctx=None): break except os.error as e: pass - time_diff = int(time.time()-start_time) + time_diff = time.time()-start_time # we start the process 1 second before screenrecord ended # to make sure there are no missing footage - time.sleep(duration-1-time_diff) + sleep_time = duration-1-time_diff + if sleep_time >= 0.: + time.sleep(sleep_time) else: time.sleep(5)