Fix crash if capture is stopped before completing startup
This commit is contained in:
+5
-2
@@ -775,9 +775,12 @@ namespace video {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (auto capture_ctx = capture_ctx_queue->pop()) {
|
// Wait for the initial capture context or a request to stop the queue
|
||||||
capture_ctxs.emplace_back(std::move(*capture_ctx));
|
auto initial_capture_ctx = capture_ctx_queue->pop();
|
||||||
|
if (!initial_capture_ctx) {
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
capture_ctxs.emplace_back(std::move(*initial_capture_ctx));
|
||||||
|
|
||||||
auto disp = platf::display(map_base_dev_type(encoder.base_dev_type), display_names[display_p], capture_ctxs.front().config);
|
auto disp = platf::display(map_base_dev_type(encoder.base_dev_type), display_names[display_p], capture_ctxs.front().config);
|
||||||
if (!disp) {
|
if (!disp) {
|
||||||
|
|||||||
Reference in New Issue
Block a user