Skip to content

Commit

Permalink
Fix recording and logging issues in send_frames
Browse files Browse the repository at this point in the history
function
  • Loading branch information
infinitel8p committed Nov 13, 2023
1 parent bfa98d6 commit 5fe520d
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,13 @@

def send_frames(ws):
global should_send_frames, streaming, recording

while streaming:
logging.info("Sending frames...")
if not should_send_frames:
time.sleep(0.1)
if recording:
ws.send("Recording in progress")
time.sleep(0.5)
continue

if recording:
logging.warning("Recording in progress, skipping frame...")
if not should_send_frames:
time.sleep(0.1)
continue

Expand Down Expand Up @@ -157,6 +155,6 @@ def start_websocket():
camera.stop_recording()
camera.close()
logging.info(
"Script interrupted by user (Ctrl+C! Recording stopped. Exiting...")
"Script interrupted by user (Ctrl+C)! Recording stopped. Exiting...")
finally:
GPIO.cleanup()

0 comments on commit 5fe520d

Please sign in to comment.