fix logic to handle no pre_event frames

This commit is contained in:
Isaac Connor 2018-05-15 15:53:25 -04:00
parent 49d75ce039
commit 5df2fbfff2
1 changed files with 1 additions and 1 deletions

View File

@ -1543,7 +1543,7 @@ bool Monitor::Analyse() {
} }
if ( score ) { if ( score ) {
if ( (state == IDLE || state == TAPE || state == PREALARM ) ) { 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", Info("%s: %03d - Gone into alarm state %u > %u",
name, image_count, Event::PreAlarmCount(), alarm_frame_count); name, image_count, Event::PreAlarmCount(), alarm_frame_count);
shared_data->state = state = ALARM; shared_data->state = state = ALARM;