aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/zoran/zoran_driver.c
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2009-02-18 17:15:46 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-03-30 12:42:56 -0300
commit84c1b09495ea366276726b0df2dcd7898cda9d0f (patch)
treef9d6a6726b322b36737f184bf594c6a6841b1d66 /drivers/media/video/zoran/zoran_driver.c
parentV4L/DVB (10712): zoran: fix G_FMT (diff)
downloadlinux-dev-84c1b09495ea366276726b0df2dcd7898cda9d0f.tar.xz
linux-dev-84c1b09495ea366276726b0df2dcd7898cda9d0f.zip
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>
Diffstat (limited to 'drivers/media/video/zoran/zoran_driver.c')
-rw-r--r--drivers/media/video/zoran/zoran_driver.c10
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)
return res;
}
+static int zoran_streamoff(struct file *file, void *__fh, enum v4l2_buf_type type);
+
static int zoran_reqbufs(struct file *file, void *__fh, struct v4l2_requestbuffers *req)
{
struct zoran_fh *fh = __fh;
@@ -2500,17 +2502,19 @@ static int zoran_reqbufs(struct file *file, void *__fh, struct v4l2_requestbuffe
int res = 0;
if (req->memory != V4L2_MEMORY_MMAP) {
- dprintk(1,
+ dprintk(2,
KERN_ERR
"%s: only MEMORY_MMAP capture is supported, not %d\n",
ZR_DEVNAME(zr), req->memory);
return -EINVAL;
}
- mutex_lock(&zr->resource_lock);
+ if (req->count == 0)
+ return zoran_streamoff(file, fh, req->type);
+ mutex_lock(&zr->resource_lock);
if (fh->v4l_buffers.allocated || fh->jpg_buffers.allocated) {
- dprintk(1,
+ dprintk(2,
KERN_ERR
"%s: VIDIOC_REQBUFS - buffers already allocated\n",
ZR_DEVNAME(zr));