mirror of
https://gitlab.freedesktop.org/monado/monado.git
synced 2025-03-03 05:06:31 +00:00
d/rs: exit early if no realsense device is connected
Previously we only exited after rs2_pipeline_start_with_config timed out.
This commit is contained in:
parent
aa7b3978b7
commit
6c6c70f700
|
@ -130,6 +130,24 @@ create_6dof(struct rs_6dof *rs)
|
|||
return 1;
|
||||
}
|
||||
|
||||
rs2_device_list *device_list = rs2_query_devices(rs->ctx, &e);
|
||||
if (check_error(rs, e) != 0) {
|
||||
close_6dof(rs);
|
||||
return 1;
|
||||
}
|
||||
|
||||
int dev_count = rs2_get_device_count(device_list, &e);
|
||||
if (check_error(rs, e) != 0) {
|
||||
close_6dof(rs);
|
||||
return 1;
|
||||
}
|
||||
|
||||
U_LOG_D("There are %d connected RealSense devices.", dev_count);
|
||||
if (0 == dev_count) {
|
||||
close_6dof(rs);
|
||||
return 1;
|
||||
}
|
||||
|
||||
rs->pipe = rs2_create_pipeline(rs->ctx, &e);
|
||||
if (check_error(rs, e) != 0) {
|
||||
close_6dof(rs);
|
||||
|
|
Loading…
Reference in a new issue