diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2019-04-29 16:02:13 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2019-04-29 16:02:13 +0200 |
commit | f8e54403c3c30bf87491d310afd827a2d7cb7f16 (patch) | |
tree | b5bf10614b2e4a4539ac0e33e54e6a9525806623 /video-opencv/video-property-page.cpp | |
parent | 9da1695192518c8f2ca7692fa45e4acbdf4dc2b7 (diff) |
video/opencv: fix crash with obscure backends
Issue: #726
Diffstat (limited to 'video-opencv/video-property-page.cpp')
-rw-r--r-- | video-opencv/video-property-page.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/video-opencv/video-property-page.cpp b/video-opencv/video-property-page.cpp index a43a5ba0..078898a5 100644 --- a/video-opencv/video-property-page.cpp +++ b/video-opencv/video-property-page.cpp @@ -14,6 +14,7 @@ #include "compat/run-in-thread.hpp" #include "compat/library-path.hpp" #include "compat/thread-name.hpp" +#include "impl.hpp" #include <cstring> @@ -49,6 +50,7 @@ prop_settings_worker::prop_settings_worker(int idx_) int ret = (int)cap.get(cv::CAP_PROP_SETTINGS); if (ret != 0) + { run_in_thread_async(qApp, [] { QMessageBox::warning(nullptr, "Camera properties", @@ -56,6 +58,7 @@ prop_settings_worker::prop_settings_worker(int idx_) QMessageBox::Cancel, QMessageBox::NoButton); }); + } else { idx = idx_; @@ -67,7 +70,7 @@ prop_settings_worker::prop_settings_worker(int idx_) void prop_settings_worker::open_prop_page() { - cap.open(idx); + cap.open(idx + opencv_camera_impl::cam::video_capture_backend); if (cap.isOpened()) { |