From 75973a2df12ba44b204dc1e334b520afd751eeb7 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Tue, 27 Apr 2021 10:28:28 -0400 Subject: [PATCH] Check for thread status before waiting. Fixes hang --- 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 27a45bbda..ee23021fa 100644 --- a/src/zm_monitor.cpp +++ b/src/zm_monitor.cpp @@ -1909,7 +1909,7 @@ bool Monitor::Analyse() { if (!(analysis_image_count % (motion_frame_skip+1))) { if (decoding_enabled) { - while (!snap->image and !snap->decoded and !zm_terminate) { + while (!snap->image and !snap->decoded and !zm_terminate and !analysis_thread->Stopped()) { // Need to wait for the decoder thread. Debug(1, "Waiting for decode"); packet_lock->wait();