From 9b9746113e701f8070d922efe8f64a4b41899200 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Fri, 4 Mar 2022 12:06:24 -0500 Subject: [PATCH] If we asked for stream, keep streaming even not decoding or other problem. We will wait for the situation to change --- src/zm_monitorstream.cpp | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/src/zm_monitorstream.cpp b/src/zm_monitorstream.cpp index 2ed568552..63e224d2d 100644 --- a/src/zm_monitorstream.cpp +++ b/src/zm_monitorstream.cpp @@ -492,19 +492,6 @@ void MonitorStream::runStream() { // Notify capture that we might want to view monitor->setLastViewed(); - if (!checkInitialised()) { - if (monitor->Capturing() != Monitor::CAPTURING_ONDEMAND) { - fputs("Content-Type: multipart/x-mixed-replace; boundary=" BOUNDARY "\r\n\r\n", stdout); - sendTextFrame("Unable to send image"); - return; - } - while (!zm_terminate && !checkInitialised()) { - Debug(1, "Waiting for capture"); - usleep(100000); - monitor->setLastViewed(); - } - } - if (type == STREAM_SINGLE) { // Not yet migrated over to stream class SingleImage(scale); @@ -524,6 +511,9 @@ void MonitorStream::runStream() { if (!checkInitialised()) { if (!loadMonitor(monitor_id)) { if (!sendTextFrame("Not connected")) return; + } else if (monitor->Capturing() == Monitor::CAPTURING_ONDEMAND) { + monitor->setLastViewed(); + if (!sendTextFrame("Waiting for capture")) return; } else { if (!sendTextFrame("Unable to stream")) return; }