Disconnect and Reconnect in PrimeCapture instead of in constructor and descructor. Fixes camera not reconnecting.

pull/3477/head
Isaac Connor 2022-04-27 15:16:02 -04:00
parent 9935e4011c
commit ee6dff8cd4
1 changed files with 3 additions and 2 deletions

View File

@ -103,8 +103,6 @@ void RemoteCameraRtsp::Initialise() {
buffer.size(max_size); buffer.size(max_size);
FFMPEGInit(); FFMPEGInit();
Connect();
} }
void RemoteCameraRtsp::Terminate() { void RemoteCameraRtsp::Terminate() {
@ -126,6 +124,9 @@ int RemoteCameraRtsp::Disconnect() {
} }
int RemoteCameraRtsp::PrimeCapture() { int RemoteCameraRtsp::PrimeCapture() {
if (rtspThread) Disconnect();
Connect();
Debug(2, "Waiting for sources"); Debug(2, "Waiting for sources");
for (int i = 100; i && !zm_terminate && !rtspThread->hasSources(); i--) { for (int i = 100; i && !zm_terminate && !rtspThread->hasSources(); i--) {
std::this_thread::sleep_for(Microseconds(10000)); std::this_thread::sleep_for(Microseconds(10000));