diff --git a/src/xrt/auxiliary/util/u_config_json.c b/src/xrt/auxiliary/util/u_config_json.c index a9b0d64bc..22a459603 100644 --- a/src/xrt/auxiliary/util/u_config_json.c +++ b/src/xrt/auxiliary/util/u_config_json.c @@ -279,15 +279,6 @@ open_tracking_settings(struct u_config_json *json) return NULL; } - int ver = -1; - bool bad = false; - - bad |= !get_obj_int(t, "version", &ver); - if (bad || ver >= 1) { - U_LOG_E("Missing or unknown version tag '%i' in tracking config", ver); - return NULL; - } - return t; } @@ -363,6 +354,15 @@ u_config_json_get_tracking_settings(struct u_config_json *json, struct xrt_setti bool bad = false; + int ver = -1; + + bad |= !get_obj_int(t, "version", &ver); + if (bad || ver >= 1) { + U_LOG_E("Missing or unknown version tag '%i' in tracking config", ver); + return NULL; + } + + bad |= !get_obj_str(t, "camera_name", s->camera_name, sizeof(s->camera_name)); bad |= !get_obj_int(t, "camera_mode", &s->camera_mode); bad |= !get_obj_str(t, "camera_type", tmp, sizeof(tmp));