diff options
author | Hans Verkuil <hverkuil@xs4all.nl> | 2009-02-18 15:15:46 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-03-30 11:42:56 -0400 |
commit | 84c1b09495ea366276726b0df2dcd7898cda9d0f (patch) | |
tree | f9d6a6726b322b36737f184bf594c6a6841b1d66 | |
parent | 5ca75b00ffd0df5bae16e84830f2710537efed11 (diff) |
V4L/DVB (10713): zoran: if reqbufs is called with count == 0, do a streamoff.
count == 0 has a special meaning, implement this.
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r-- | drivers/media/video/zoran/zoran_driver.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/media/video/zoran/zoran_driver.c b/drivers/media/video/zoran/zoran_driver.c index 7129f9254e70..07f2bdfef4ee 100644 --- a/drivers/media/video/zoran/zoran_driver.c +++ b/drivers/media/video/zoran/zoran_driver.c | |||
@@ -2493,6 +2493,8 @@ static int zoran_overlay(struct file *file, void *__fh, unsigned int on) | |||
2493 | return res; | 2493 | return res; |
2494 | } | 2494 | } |
2495 | 2495 | ||
2496 | static int zoran_streamoff(struct file *file, void *__fh, enum v4l2_buf_type type); | ||
2497 | |||
2496 | static int zoran_reqbufs(struct file *file, void *__fh, struct v4l2_requestbuffers *req) | 2498 | static int zoran_reqbufs(struct file *file, void *__fh, struct v4l2_requestbuffers *req) |
2497 | { | 2499 | { |
2498 | struct zoran_fh *fh = __fh; | 2500 | struct zoran_fh *fh = __fh; |
@@ -2500,17 +2502,19 @@ static int zoran_reqbufs(struct file *file, void *__fh, struct v4l2_requestbuffe | |||
2500 | int res = 0; | 2502 | int res = 0; |
2501 | 2503 | ||
2502 | if (req->memory != V4L2_MEMORY_MMAP) { | 2504 | if (req->memory != V4L2_MEMORY_MMAP) { |
2503 | dprintk(1, | 2505 | dprintk(2, |
2504 | KERN_ERR | 2506 | KERN_ERR |
2505 | "%s: only MEMORY_MMAP capture is supported, not %d\n", | 2507 | "%s: only MEMORY_MMAP capture is supported, not %d\n", |
2506 | ZR_DEVNAME(zr), req->memory); | 2508 | ZR_DEVNAME(zr), req->memory); |
2507 | return -EINVAL; | 2509 | return -EINVAL; |
2508 | } | 2510 | } |
2509 | 2511 | ||
2510 | mutex_lock(&zr->resource_lock); | 2512 | if (req->count == 0) |
2513 | return zoran_streamoff(file, fh, req->type); | ||
2511 | 2514 | ||
2515 | mutex_lock(&zr->resource_lock); | ||
2512 | if (fh->v4l_buffers.allocated || fh->jpg_buffers.allocated) { | 2516 | if (fh->v4l_buffers.allocated || fh->jpg_buffers.allocated) { |
2513 | dprintk(1, | 2517 | dprintk(2, |
2514 | KERN_ERR | 2518 | KERN_ERR |
2515 | "%s: VIDIOC_REQBUFS - buffers already allocated\n", | 2519 | "%s: VIDIOC_REQBUFS - buffers already allocated\n", |
2516 | ZR_DEVNAME(zr)); | 2520 | ZR_DEVNAME(zr)); |