summaryrefslogtreecommitdiffhomepage
path: root/tracker-pt/ftnoir_tracker_pt.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2017-06-10 12:50:25 +0200
committerStanislaw Halik <sthalik@misaki.pl>2017-06-10 12:50:25 +0200
commitd415d383db1e1cf8038ffb34459864e3b6e19f39 (patch)
tree888cfaaab4733269b4342ea0337460f774c87023 /tracker-pt/ftnoir_tracker_pt.cpp
parent1a4ad209341b7ef2364f7b6bc8195a4ac93838d0 (diff)
minor cleanup only
Diffstat (limited to 'tracker-pt/ftnoir_tracker_pt.cpp')
-rw-r--r--tracker-pt/ftnoir_tracker_pt.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/tracker-pt/ftnoir_tracker_pt.cpp b/tracker-pt/ftnoir_tracker_pt.cpp
index 36eabcc9..2862efdb 100644
--- a/tracker-pt/ftnoir_tracker_pt.cpp
+++ b/tracker-pt/ftnoir_tracker_pt.cpp
@@ -59,16 +59,16 @@ void Tracker_PT::run()
QTextStream log_stream(&log_file);
#endif
- maybe_reopen_camera();
-
while((commands & ABORT) == 0)
{
CamInfo cam_info;
- bool new_frame;
+ bool new_frame = false;
{
QMutexLocker l(&camera_mtx);
- std::tie(new_frame, cam_info) = camera.get_frame(frame);
+
+ if (likely(camera))
+ std::tie(new_frame, cam_info) = camera.get_frame(frame);
}
if (new_frame)
@@ -136,7 +136,6 @@ void Tracker_PT::maybe_reopen_camera()
switch (status)
{
case Camera::open_error:
- qDebug() << "can't start camera" << s.camera_name;
break;
case Camera::open_ok_change:
frame = cv::Mat();
@@ -167,7 +166,10 @@ void Tracker_PT::start_tracker(QFrame* video_frame)
video_frame->setLayout(layout.data());
//video_widget->resize(video_frame->width(), video_frame->height());
video_frame->show();
- start();
+
+ maybe_reopen_camera();
+
+ start(QThread::HighPriority);
}
void Tracker_PT::data(double *data)