From fa22129966f93735698e2efa61476432b8ab66e2 Mon Sep 17 00:00:00 2001 From: Admin Date: Thu, 4 Mar 2021 20:20:02 +0100 Subject: [PATCH] Make last_alarm_count last alarmed frame while only in ALARM state to make post_event_count counts since here not alone alarmed frames that don't shot alarms. --- src/zm_monitor.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/zm_monitor.cpp b/src/zm_monitor.cpp index 7d00cf4d5..ef0ee05b2 100644 --- a/src/zm_monitor.cpp +++ b/src/zm_monitor.cpp @@ -2138,7 +2138,9 @@ bool Monitor::Analyse() { Debug(1, "Staying in %s", State_Strings[state].c_str()); } - last_alarm_count = analysis_image_count; + if ( state == ALARM ) { + last_alarm_count = analysis_image_count; + } // This is needed so post_event_count counts after last alarmed frames while in ALARM not single alarmed frames while ALERT } else { // no score? alert_to_alarm_frame_count = alarm_frame_count; // load same value configured for alarm_frame_count if (state == ALARM) {