fix min_section_length not being honoured

This commit is contained in:
Isaac Connor 2021-01-27 18:13:16 -05:00
parent c4b80e61bc
commit 7923e0c279
1 changed files with 5 additions and 1 deletions

View File

@ -2104,7 +2104,11 @@ bool Monitor::Analyse() {
Info("%s: %03d - Gone into alert state", name, analysis_image_count);
shared_data->state = state = ALERT;
} else if ( state == ALERT ) {
if ( analysis_image_count-last_alarm_count > post_event_count ) {
if (
( analysis_image_count-last_alarm_count > post_event_count )
&&
( ( timestamp->tv_sec - video_store_data->recording.tv_sec ) >= min_section_length )
) {
Info("%s: %03d - Left alarm state (%" PRIu64 ") - %d(%d) images",
name, analysis_image_count, event->Id(), event->Frames(), event->AlarmFrames());
//if ( function != MOCORD || event_close_mode == CLOSE_ALARM || event->Cause() == SIGNAL_CAUSE )