We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8cab930 commit 1f7a5f3Copy full SHA for 1f7a5f3
1 file changed
src/libcameracamera.cpp
@@ -212,10 +212,16 @@ void LibCameraWorker::captureImage()
212
return;
213
}
214
215
- // Wait for pending requests to complete
216
- while (!mPendingRequests.empty()) {
+ // Wait for pending requests to complete with timeout
+ const auto deadline = std::chrono::steady_clock::now() + std::chrono::seconds(1);
217
+ while (!mPendingRequests.empty() && std::chrono::steady_clock::now() < deadline) {
218
std::this_thread::sleep_for(std::chrono::milliseconds(5));
219
220
+
221
+ if (!mPendingRequests.empty()) {
222
+ emit errorOccurred("libcamera: timeout waiting for pending preview image requests");
223
+ return;
224
+ }
225
226
mCaptureInProgress = true;
227
0 commit comments