From 4392198d144605ddb6fb077a51fbfc78f9a52b68 Mon Sep 17 00:00:00 2001 From: Peter Keresztes Schmidt Date: Sat, 10 Jul 2021 00:54:15 +0200 Subject: [PATCH] Fix closing event in MOCORD mode Bug introduced in 707975e567143894f94f983c96d3d1b86cd3004c --- 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 495cd09f0..60b02c2e9 100644 --- a/src/zm_monitor.cpp +++ b/src/zm_monitor.cpp @@ -1929,7 +1929,7 @@ bool Monitor::Analyse() { if (section_length != Seconds(0) && (timestamp - GetVideoWriterStartTime() >= section_length) && ((function == MOCORD && event_close_mode != CLOSE_TIME) || (function == RECORD && event_close_mode == CLOSE_TIME) - || timestamp.time_since_epoch() % section_length == Seconds(0))) { + || std::chrono::duration_cast(timestamp.time_since_epoch()) % section_length == Seconds(0))) { Info("%s: %03d - Closing event %" PRIu64 ", section end forced %" PRIi64 " - %" PRIi64 " = %" PRIi64 " >= %" PRIi64 , name.c_str(), image_count,