diff --git a/src/zm_monitor.cpp b/src/zm_monitor.cpp index fbac7843f..faad9e6fe 100644 --- a/src/zm_monitor.cpp +++ b/src/zm_monitor.cpp @@ -562,6 +562,7 @@ void Monitor::Load(MYSQL_ROW dbrow, bool load_zones=true, Purpose p = QUERY) { // How many frames we need to have before we start analysing ready_count = std::max(warmup_count, pre_event_count); + image_count = 0; last_alarm_count = 0; state = IDLE; last_signal = true; // Defaulting to having signal so that we don't get a signal change on the first frame. diff --git a/src/zm_monitor.h b/src/zm_monitor.h index 15400440d..e626187ad 100644 --- a/src/zm_monitor.h +++ b/src/zm_monitor.h @@ -709,6 +709,7 @@ public: return false; } if (image_count >= ready_count) { + Debug(2, "Ready because image_count(%d) >= ready_count(%d)", image_count, ready_count); return true; } Debug(2, "Not ready because image_count(%d) <= ready_count(%d)", image_count, ready_count);