From ae17b2316e75a22c94bef058ab707df86195c6f0 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Mon, 24 Jan 2022 20:07:14 -0500 Subject: [PATCH] break out when zm_terminate is true --- src/zm_remote_camera_rtsp.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/zm_remote_camera_rtsp.cpp b/src/zm_remote_camera_rtsp.cpp index e35217cc8..7610c4deb 100644 --- a/src/zm_remote_camera_rtsp.cpp +++ b/src/zm_remote_camera_rtsp.cpp @@ -22,6 +22,7 @@ #include "zm_config.h" #include "zm_monitor.h" #include "zm_packet.h" +#include "zm_signal.h" #if HAVE_LIBAVFORMAT @@ -128,7 +129,7 @@ int RemoteCameraRtsp::Disconnect() { int RemoteCameraRtsp::PrimeCapture() { Debug(2, "Waiting for sources"); - for ( int i = 0; (i < 100) && !rtspThread->hasSources(); i++ ) { + for ( int i = 100; i &&zm_terminate && !rtspThread->hasSources(); i-- ) { usleep(100000); } if ( !rtspThread->hasSources() ) {