diff --git a/src/zm_monitor.cpp b/src/zm_monitor.cpp index 026fad766..71dc9d2d5 100644 --- a/src/zm_monitor.cpp +++ b/src/zm_monitor.cpp @@ -1822,8 +1822,8 @@ bool Monitor::Analyse() { Debug(1, "Linked monitor %d %s is connected", linked_monitors[i]->Id(), linked_monitors[i]->Name()); if (linked_monitors[i]->hasAlarmed()) { - Debug(1, "Linked monitor %d %s is alarmed", - linked_monitors[i]->Id(), linked_monitors[i]->Name()); + Debug(1, "Linked monitor %d %s is alarmed score will be %d", + linked_monitors[i]->Id(), linked_monitors[i]->Name(), linked_monitors[i]->lastFrameScore()); if (!event) { if (first_link) { if (cause.length()) @@ -1948,6 +1948,9 @@ bool Monitor::Analyse() { } // end if active and doing motion detection + // Set this before any state changes so that it's value is picked up immediately by linked monitors + shared_data->last_frame_score = score; + // If motion detecting, score will be > 0 on motion, but if skipping frames, might not be. So also test snap->score if ((score > 0) or ((snap->score > 0) and (function != MONITOR))) { if ((state == IDLE) || (state == TAPE) || (state == PREALARM)) { @@ -2160,7 +2163,6 @@ bool Monitor::Analyse() { last_signal = signal; } // end if videostream } // end if signal - shared_data->last_frame_score = score; } else { Debug(3, "trigger == off"); if (event) {