From a676f7c407893903692b1abc2d25d024cc98c424 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Mon, 31 May 2021 15:59:36 -0400 Subject: [PATCH] SHould reset state as well as shared_data->state --- src/zm_monitor.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/zm_monitor.cpp b/src/zm_monitor.cpp index fb728ef3d..60474c541 100644 --- a/src/zm_monitor.cpp +++ b/src/zm_monitor.cpp @@ -1009,7 +1009,7 @@ bool Monitor::connect() { shared_data->signal = false; shared_data->capture_fps = 0.0; shared_data->analysis_fps = 0.0; - shared_data->state = IDLE; + shared_data->state = state = IDLE; shared_data->last_write_index = image_buffer_count; shared_data->last_read_index = image_buffer_count; shared_data->last_write_time = 0; @@ -2206,8 +2206,8 @@ bool Monitor::Analyse() { snap->analysis_image = new Image(*(snap->image)); snap->analysis_image->Overlay(*(zone.AlarmImage())); } - } // end if zone is alarmed - } // end foreach zone + } // end if zone is alarmed + } // end foreach zone if (event) { if (noteSetMap.size() > 0) event->updateNotes(noteSetMap); @@ -2253,7 +2253,7 @@ bool Monitor::Analyse() { shared_data->last_frame_score = score; } else { Debug(3, "trigger == off"); - if ( event ) { + if (event) { Info("%s: %03d - Closing event %" PRIu64 ", trigger off", name.c_str(), analysis_image_count, event->Id()); closeEvent(); } @@ -2277,7 +2277,7 @@ bool Monitor::Analyse() { // Only do these if it's a video packet. shared_data->last_read_index = snap->image_index; analysis_image_count++; - if ( function == MODECT or function == MOCORD ) + if (function == MODECT or function == MOCORD) UpdateAnalysisFPS(); } packetqueue.unlock(packet_lock);