drivers: don't initialize masks_sink if slam is disabled

Co-authored-by: Simon Zeni <simon.zeni@collabora.com>
This commit is contained in:
Mateo de Mayo 2024-03-13 14:45:14 -04:00 committed by Simon Zeni
parent 55bd054ddd
commit a8eb098e14
4 changed files with 4 additions and 4 deletions

View file

@ -404,7 +404,7 @@ rift_s_tracker_create(struct xrt_tracking_origin *origin,
// Initialize hand tracker
struct xrt_slam_sinks *hand_sinks = NULL;
struct xrt_device *hand_device = NULL;
struct xrt_hand_masks_sink *masks_sink = slam_sinks->hand_masks;
struct xrt_hand_masks_sink *masks_sink = slam_sinks ? slam_sinks->hand_masks : NULL;
if (t->tracking.hand_enabled) {
int hand_status = rift_s_create_hand_tracker(t, xfctx, masks_sink, &hand_sinks, &hand_device);
if (hand_status != 0 || hand_sinks == NULL || hand_device == NULL) {

View file

@ -1872,7 +1872,7 @@ wmr_hmd_setup_trackers(struct wmr_hmd *wh, struct xrt_slam_sinks *out_sinks, str
// Initialize hand tracker
struct xrt_slam_sinks *hand_sinks = NULL;
struct xrt_device *hand_device = NULL;
struct xrt_hand_masks_sink *masks_sink = slam_sinks->hand_masks;
struct xrt_hand_masks_sink *masks_sink = slam_sinks ? slam_sinks->hand_masks : NULL;
if (wh->tracking.hand_enabled) {
int hand_status = wmr_hmd_hand_track(wh, stereo_calib, masks_sink, &hand_sinks, &hand_device);
if (hand_status != 0 || hand_sinks == NULL || hand_device == NULL) {

View file

@ -385,7 +385,7 @@ valve_index_setup_visual_trackers(struct lighthouse_system *lhs,
// Initialize hand tracker
struct xrt_slam_sinks *hand_sinks = NULL;
struct xrt_device *hand_devices[2] = {NULL};
struct xrt_hand_masks_sink *masks_sink = (slam_enabled ? slam_sinks->hand_masks : NULL);
struct xrt_hand_masks_sink *masks_sink = slam_sinks ? slam_sinks->hand_masks : NULL;
if (hand_enabled) {
bool success = valve_index_hand_track( //
lhs, //

View file

@ -308,7 +308,7 @@ ns_setup_depthai_device(struct ns_builder *nsb,
#ifdef XRT_BUILD_DRIVER_HANDTRACKING
struct xrt_slam_sinks *hand_sinks = NULL;
struct xrt_hand_masks_sink *masks_sink = slam_sinks->hand_masks;
struct xrt_hand_masks_sink *masks_sink = slam_sinks ? slam_sinks->hand_masks : NULL;
struct t_camera_extra_info extra_camera_info = {0};