summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2015-12-06 00:41:59 +0100
committerStanislaw Halik <sthalik@misaki.pl>2015-12-06 00:41:59 +0100
commit0f577dbe8adb8f7e210241c6bee0be73349f8d45 (patch)
treefaf4fcdb5d13b55a75f72b6318922edb26a14b86
parent14550c0f9070bc108c865736364349b3e8d1f995 (diff)
tracker/aruco, tracker/pt: sleep before releasing camera
Really fast toggling tracking crashed with my PS3 Eye.
-rw-r--r--tracker-aruco/ftnoir_tracker_aruco.cpp2
-rw-r--r--tracker-pt/ftnoir_tracker_pt.cpp3
2 files changed, 5 insertions, 0 deletions
diff --git a/tracker-aruco/ftnoir_tracker_aruco.cpp b/tracker-aruco/ftnoir_tracker_aruco.cpp
index 2b38bb2f..1da5b8df 100644
--- a/tracker-aruco/ftnoir_tracker_aruco.cpp
+++ b/tracker-aruco/ftnoir_tracker_aruco.cpp
@@ -43,6 +43,8 @@ Tracker::~Tracker()
delete videoWidget;
if(layout)
delete layout;
+ // fast start/stop causes breakage
+ portable::sleep(1000);
camera.release();
}
diff --git a/tracker-pt/ftnoir_tracker_pt.cpp b/tracker-pt/ftnoir_tracker_pt.cpp
index 15a60962..2dbf9068 100644
--- a/tracker-pt/ftnoir_tracker_pt.cpp
+++ b/tracker-pt/ftnoir_tracker_pt.cpp
@@ -13,6 +13,7 @@
#include <QFile>
#include <QCoreApplication>
#include "opentrack/camera-names.hpp"
+#include "opentrack-compat/sleep.hpp"
//#define PT_PERF_LOG //log performance
@@ -34,6 +35,8 @@ Tracker_PT::~Tracker_PT()
delete video_widget;
video_widget = NULL;
if (video_frame->layout()) delete video_frame->layout();
+ // fast start/stop causes breakage
+ portable::sleep(1000);
camera.stop();
}