break out when zm_terminate is true

This commit is contained in:
Isaac Connor 2022-01-24 20:07:14 -05:00
parent 8891feec74
commit ae17b2316e
1 changed files with 2 additions and 1 deletions

View File

@ -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() ) {