Updated close method for ieee1394 cameras

This commit is contained in:
Alexander Reshetnikov 2012-03-29 11:56:53 +00:00
parent 857676c610
commit ee8c4aeb4b

View File

@ -493,8 +493,11 @@ void CvCaptureCAM_DC1394_v2_CPP::close()
{
if (dcCam)
{
if (FD_ISSET(dc1394_capture_get_fileno(dcCam), &dc1394.camFds))
FD_CLR(dc1394_capture_get_fileno(dcCam), &dc1394.camFds);
// check for fileno valid before using
int fileno=dc1394_capture_get_fileno(dcCam);
if (fileno>=0 && FD_ISSET(fileno, &dc1394.camFds))
FD_CLR(fileno, &dc1394.camFds);
dc1394_video_set_transmission(dcCam, DC1394_OFF);
dc1394_capture_stop(dcCam);
dc1394_camera_free(dcCam);