Skip to content

Conversation

@richmattes
Copy link
Contributor

This PR includes fixes to use the OpenCV api in C++ mode, and fixes to some error handling issues I found when trying to run "freenect-cvdemo" without a kinect plugged into the PC (the application would segfault instead of notifying the user that it could not open a camera.) It should fix #553.

Signed-off-by: Rich Mattes <richmattes@gmail.com>
fnusb_open_subdevices checked for camera==NULL or res < 0 before jumping to the failure case. If camera was NULL but res was not 0, the function would return 0 indicating success. This occurs when a kinect is not plugged into the PC. Forcing res to be negative when the camera == NULL case allows the failure to open a device to propagate through an application. alloc_kinect in freenect_sync has a check for if freenect_open_device fails, but the logic is incorrect. freenect_open_device returns 0 on success and < 0 on error, so adding a check to see if the return is < 0 corrects detection of the failure case. Signed-off-by: Rich Mattes <richmattes@gmail.com>
@piedar piedar merged commit b1d88af into OpenKinect:master May 26, 2018
@piedar piedar added this to the v0.6.0 milestone Feb 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants