diff --git a/app/src/main/cpp/PhoneDevice.cpp b/app/src/main/cpp/PhoneDevice.cpp index 1b85e0be..2848e3be 100644 --- a/app/src/main/cpp/PhoneDevice.cpp +++ b/app/src/main/cpp/PhoneDevice.cpp @@ -1697,9 +1697,12 @@ bool CPhoneDevice::TakePhoto(const IDevice::PHOTO_INFO& photoInfo, const vector< std::this_thread::sleep_for(std::chrono::seconds(2)); } time_t ts = time(NULL); + if(!GetPTZSensorsStatus() && !GetCameraStatus()) + { + OpenPTZSensors(120); + } CameraPhotoCmd(ts, photoInfo.channel, 0, 6, 0); - TakePTZPhotoCb(3, photoInfo); - res = true; + res = TakePTZPhotoCb(3, photoInfo); } else if (mPhotoInfo.usingSysCamera == 1) { @@ -1837,7 +1840,7 @@ bool CPhoneDevice::ClosePTZSensors() { m_shouldStopWaiting.store(true); } - else + else if(m_sensorsStatus && m_cameraStatus) { std::lock_guard lock(m_cameraLocker); // std::unique_lock lock(m_cameraLocker);