Skip to content

Commit

Permalink
include pose age in timing calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
xytovl committed Apr 16, 2021
1 parent f7cc355 commit fcd3d78
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion alvr/server/cpp/platform/linux/CEncoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ bool CEncoder::UpdatePoseIndex()

auto now = std::chrono::system_clock::now();
// be careful not to cast absolute durations to float, this won't have enough accuracy
std::chrono::microseconds offset(std::chrono::microseconds::rep(frames[i].m_flTotalRenderGpuMs / 1000));
std::chrono::microseconds offset(std::chrono::microseconds::rep((frames[i].m_flTotalRenderGpuMs - frames[i].m_flNewPosesReadyMs) / 1000));
auto server_pose_time = std::chrono::duration_cast<std::chrono::microseconds>((now - offset).time_since_epoch());
auto client_pose_time = m_listener->serverToClientTime(server_pose_time.count());
auto pose = m_poseHistory->GetPoseAt(client_pose_time);
Expand Down

0 comments on commit fcd3d78

Please sign in to comment.