From 5174eb94b844deb0dc3a34cd18d54b71b3dd0730 Mon Sep 17 00:00:00 2001 From: Siyuan Date: Fri, 21 Nov 2025 12:18:14 +0000 Subject: [PATCH] fix based on copilot suggestions --- internal/native/cgo/video.c | 3 +-- internal/native/video.go | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/native/cgo/video.c b/internal/native/cgo/video.c index 92cd6f03..9107c70e 100644 --- a/internal/native/cgo/video.c +++ b/internal/native/cgo/video.c @@ -762,7 +762,6 @@ void video_stop_streaming() uint8_t video_get_streaming_status() { // streaming flag can be false when stopping streaming if (get_streaming_flag() == true) return 1; - // streaming_stopped isn't protected by a mutex, but we won't care about race conditions here if (get_streaming_stopped() == false) return 2; return 0; } @@ -781,7 +780,7 @@ void video_restart_streaming() } if (!wait_for_streaming_stopped()) { - return ; + return; } video_start_streaming(); diff --git a/internal/native/video.go b/internal/native/video.go index c360441b..176511c6 100644 --- a/internal/native/video.go +++ b/internal/native/video.go @@ -47,6 +47,7 @@ func (n *Native) waitForVideoStreamingStatus(status VideoStreamingStatus) error } } +// before calling this function, make sure to lock n.videoLock func (n *Native) setSleepMode(enabled bool) error { if !n.sleepModeSupported { return nil