Merge pull request #3198 from SirLouen/3197-record-event-close-mode

Issue #3197 Add RECORD to Event_Close_Mode time
pull/3199/head
Isaac Connor 2021-03-21 13:04:08 -04:00 committed by GitHub
commit 5f5648317c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 3 deletions

View File

@ -1975,9 +1975,15 @@ bool Monitor::Analyse() {
// If doing record, check to see if we need to close the event or not.
if (event) {
Debug(2, "Have event %" PRIu64 " in mocord", event->Id());
if (section_length
&& ( ( timestamp->tv_sec - video_store_data->recording.tv_sec ) >= section_length )
&& ( (function == MOCORD && (event_close_mode != CLOSE_TIME)) || ! ( timestamp->tv_sec % section_length ) )
if (section_length &&
( ( timestamp->tv_sec - video_store_data->recording.tv_sec ) >= section_length )
&& (
( (function == MOCORD) && (event_close_mode != CLOSE_TIME) )
||
( (function == RECORD) && (event_close_mode == CLOSE_TIME) )
|| ! ( timestamp->tv_sec % section_length )
)
) {
Info("%s: %03d - Closing event %" PRIu64 ", section end forced %d - %d = %d >= %d",
name, image_count, event->Id(),