Check for thread status before waiting. Fixes hang

This commit is contained in:
Isaac Connor committed 2021-04-27 10:28:46 -04:00
1 parent 9f49ac217e
commit 75973a2df1
1 file changed
+1 -1
+1 -1
View File
@@ -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();