projects
/
profile
/
ivi
/
opencv.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
857676c
)
Updated close method for ieee1394 cameras
author
Alexander Reshetnikov
<no@email>
Thu, 29 Mar 2012 11:56:53 +0000
(11:56 +0000)
committer
Alexander Reshetnikov
<no@email>
Thu, 29 Mar 2012 11:56:53 +0000
(11:56 +0000)
modules/highgui/src/cap_dc1394_v2.cpp
patch
|
blob
|
history
diff --git
a/modules/highgui/src/cap_dc1394_v2.cpp
b/modules/highgui/src/cap_dc1394_v2.cpp
index
81b2916
..
a3bce0d
100644
(file)
--- a/
modules/highgui/src/cap_dc1394_v2.cpp
+++ b/
modules/highgui/src/cap_dc1394_v2.cpp
@@
-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);