fix based on copilot suggestions

This commit is contained in:
Siyuan 2025-11-21 12:18:14 +00:00
parent 0fac7f4116
commit 5174eb94b8
2 changed files with 2 additions and 2 deletions

View File

@ -762,7 +762,6 @@ void video_stop_streaming()
uint8_t video_get_streaming_status() { uint8_t video_get_streaming_status() {
// streaming flag can be false when stopping streaming // streaming flag can be false when stopping streaming
if (get_streaming_flag() == true) return 1; 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; if (get_streaming_stopped() == false) return 2;
return 0; return 0;
} }

View File

@ -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 { func (n *Native) setSleepMode(enabled bool) error {
if !n.sleepModeSupported { if !n.sleepModeSupported {
return nil return nil