From 5df2fbfff2826fdde209ba0e6c85c6a9d0870bb8 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Tue, 15 May 2018 15:53:25 -0400 Subject: [PATCH] fix logic to handle no pre_event frames --- src/zm_monitor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/zm_monitor.cpp b/src/zm_monitor.cpp index d9b07e40f..e8e14b3c4 100644 --- a/src/zm_monitor.cpp +++ b/src/zm_monitor.cpp @@ -1543,7 +1543,7 @@ bool Monitor::Analyse() { } if ( score ) { if ( (state == IDLE || state == TAPE || state == PREALARM ) ) { - if ( Event::PreAlarmCount() > alarm_frame_count ) { + if ( (!pre_event_count) || (Event::PreAlarmCount() >= alarm_frame_count) ) { Info("%s: %03d - Gone into alarm state %u > %u", name, image_count, Event::PreAlarmCount(), alarm_frame_count); shared_data->state = state = ALARM;