@@ -40,6 +40,8 @@ MODULE_LICENSE("GPL");
if (debug >= level) \
printk(KERN_DEBUG "vbuf: " fmt , ## arg); } while (0)
+static int __videobuf_streamoff(struct videobuf_queue *q);
+
/* --------------------------------------------------------------------- */
#define CALL(q, f, arg...) \
@@ -395,11 +397,6 @@ int videobuf_reqbufs(struct videobuf_queue *q,
unsigned int size, count;
int retval;
- if (req->count < 1) {
- dprintk(1, "reqbufs: count invalid (%d)\n", req->count);
- return -EINVAL;
- }
-
if (req->memory != V4L2_MEMORY_MMAP &&
req->memory != V4L2_MEMORY_USERPTR &&
req->memory != V4L2_MEMORY_OVERLAY) {
@@ -414,6 +411,12 @@ int videobuf_reqbufs(struct videobuf_queue *q,
goto done;
}
+ if (req->count == 0) {
+ __videobuf_streamoff(q);
+ retval = 0;
+ goto done;
+ }
+
if (q->streaming) {
dprintk(1, "reqbufs: streaming already exists\n");
retval = -EBUSY;