I think the ioctl VIDIOC_DQBUF in pwc does not follow the API spec.
It should not block if there are no buffers and the device has been
opened with O_NONBLOCK.

I am not sure the patch is 100% correct, since I do not understand it
completely.

Andrea
diff -r 87aa6048e718 linux/drivers/media/video/pwc/pwc-v4l.c
--- a/linux/drivers/media/video/pwc/pwc-v4l.c   Wed Jul 02 08:59:38 2008 -0300
+++ b/linux/drivers/media/video/pwc/pwc-v4l.c   Sat Jul 05 14:14:03 2008 +0100
@@ -1134,6 +1134,13 @@
                                     frameq is safe now.
                         */
                        add_wait_queue(&pdev->frameq, &wait);
+
+                       if ((pdev->full_frames == NULL) && (file->f_flags & 
O_NONBLOCK)) {
+                               remove_wait_queue(&pdev->frameq, &wait);
+                               set_current_state(TASK_RUNNING);
+                               return -EAGAIN;
+                       }
+
                        while (pdev->full_frames == NULL) {
                                if (pdev->error_status) {
                                        remove_wait_queue(&pdev->frameq, &wait);
_______________________________________________
pwc mailing list
[email protected]
http://lists.saillard.org/mailman/listinfo/pwc

Reply via email to