aux/config_json: Only check version for camera tracking config

Only the camera tracking config writes and uses the version field.

Unfortunately the tracking override config is written into the same json
object while not making use of the version field.
This commit is contained in:
Christoph Haag authored and Jakob Bornecrantz committed 2022-03-22 12:35:01 +00:00
1 parent d43c7ffa71
commit 6fdd8ab93a
1 file changed
+9 -9
+9 -9
View File
@@ -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));