diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2017-06-10 12:50:25 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2017-06-10 12:50:25 +0200 |
commit | d415d383db1e1cf8038ffb34459864e3b6e19f39 (patch) | |
tree | 888cfaaab4733269b4342ea0337460f774c87023 /tracker-pt/ftnoir_tracker_pt.cpp | |
parent | 1a4ad209341b7ef2364f7b6bc8195a4ac93838d0 (diff) |
minor cleanup only
Diffstat (limited to 'tracker-pt/ftnoir_tracker_pt.cpp')
-rw-r--r-- | tracker-pt/ftnoir_tracker_pt.cpp | 14 |
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) |