From 83c96d8324b19240935406881bd4aea44104d2b5 Mon Sep 17 00:00:00 2001 From: mrlt8 <67088095+mrlt8@users.noreply.github.com> Date: Sat, 5 Aug 2023 21:01:07 -0700 Subject: [PATCH] Revert "Skip audio buffer check #388" This reverts commit 79ace0cbcd931b79993fff9368ea79f34cd5530e. --- app/wyzecam/iotc.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/wyzecam/iotc.py b/app/wyzecam/iotc.py index 7cf0ac3f..abfd1246 100644 --- a/app/wyzecam/iotc.py +++ b/app/wyzecam/iotc.py @@ -593,6 +593,11 @@ def recv_audio_frames(self, uri: str) -> None: self.state == WyzeIOTCSessionState.AUTHENTICATION_SUCCEEDED and self.stream_state.value > 1 ): + if (buf := tutk.av_check_audio_buf(*tutav)) < 1: + if buf < 0: + raise tutk.TutkError(buf) + time.sleep(sleep_interval) + continue errno, frame_data, _ = tutk.av_recv_audio_data(*tutav) if errno < 0: if errno in ( @@ -600,7 +605,6 @@ def recv_audio_frames(self, uri: str) -> None: tutk.AV_ER_INCOMPLETE_FRAME, tutk.AV_ER_LOSED_THIS_FRAME, ): - time.sleep(sleep_interval) continue warnings.warn(f"Error: {errno=}") break