From: <enl...@li...> - 2000-11-08 20:29:55
|
Enlightenment CVS committal Author : gilbertt Project : misc Module : camE Modified Files: webcam.c Log Message: better check for devices that can't be mmap()d =================================================================== RCS file: /cvsroot/enlightenment/misc/camE/webcam.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -3 -r1.7 -r1.8 --- webcam.c 2000/11/06 16:31:10 1.7 +++ webcam.c 2000/11/08 20:29:54 1.8 @@ -144,7 +144,7 @@ grab_size = vid_mbuf.size; grab_data = mmap(0, grab_size, PROT_READ | PROT_WRITE, MAP_SHARED, grab_fd, 0); - if (grab_data == NULL) + if ((grab_data == NULL) || (-1 == (int)grab_data)) { fprintf(stderr, "couldn't mmap vidcam. your card doesn't support that?\n"); @@ -158,6 +158,7 @@ Imlib_Image im; int i = 0; int j = lag_reduce; + if (j == 0) j++; while (j--) { |