diff options
Diffstat (limited to 'tracker-rs/ftnoir_tracker_rs_worker.cpp')
-rw-r--r-- | tracker-rs/ftnoir_tracker_rs_worker.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/tracker-rs/ftnoir_tracker_rs_worker.cpp b/tracker-rs/ftnoir_tracker_rs_worker.cpp index c387b731..213f13ff 100644 --- a/tracker-rs/ftnoir_tracker_rs_worker.cpp +++ b/tracker-rs/ftnoir_tracker_rs_worker.cpp @@ -29,13 +29,14 @@ void RSTrackerWorkerThread::run(){ while(!isInterruptionRequested()){ retValue = rs_tracker_impl_update_pose(pose); - if(retValue!=0 && retValue!=-303){ // -303 is only a timeout. + if(retValue == 0){ // success + QMutexLocker lock(&mMutex); + memcpy(mPose, pose, sizeof(pose)); + } + else if(retValue != -303){ // pose update failed. -303 is OK as it's only a timeout. emit trackingHasFinished(retValue); break; } - - QMutexLocker lock(&mMutex); - memcpy(mPose, pose, sizeof(pose)); } rs_tracker_impl_end(); |