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;