From 33f98a0d40e5867984526a6156bc6f1ca6b13098 Mon Sep 17 00:00:00 2001 From: SirLouen Date: Sat, 20 Mar 2021 20:02:52 +0100 Subject: [PATCH 1/2] Issue #3197 Add RECORD to Event_Close_Mode time --- 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 8fc0a507a..9fb398bdb 100644 --- a/src/zm_monitor.cpp +++ b/src/zm_monitor.cpp @@ -1979,7 +1979,7 @@ bool Monitor::Analyse() { 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 ) ) + && ( ( ( (function == MOCORD) || (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", From db7e9edcab43b5adae6550f2a590a7cc471f24ba Mon Sep 17 00:00:00 2001 From: SirLouen Date: Sun, 21 Mar 2021 00:00:36 +0100 Subject: [PATCH 2/2] Issue #3197 Improvement --- src/zm_monitor.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/zm_monitor.cpp b/src/zm_monitor.cpp index 9fb398bdb..58977dc2c 100644 --- a/src/zm_monitor.cpp +++ b/src/zm_monitor.cpp @@ -1977,11 +1977,10 @@ bool Monitor::Analyse() { 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) || (function == RECORD) ) && (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(), timestamp->tv_sec, video_store_data->recording.tv_sec,