rustpotter detections optimization + few code improvements

This commit is contained in:
Priler 2026-01-04 06:14:05 +05:00
parent 612ed2f1b0
commit a425d8f834
12 changed files with 64 additions and 58 deletions

View file

@ -175,7 +175,7 @@ pub fn start_recording(device_index: i32, frame_length: u32) {
pub fn stop_recording() {
// ensure microphone is initialized
RECORDER.with(|recorder| {
if !recorder.get().is_none() && IS_RECORDING.load(Ordering::SeqCst) {
if recorder.get().is_some() && IS_RECORDING.load(Ordering::SeqCst) {
// pause instead of stop
match recorder.get().unwrap().load().pause() {
Err(msg) => {