summaryrefslogtreecommitdiff
path: root/linux
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2009-02-18 21:15:46 +0100
committerHans Verkuil <hverkuil@xs4all.nl>2009-02-18 21:15:46 +0100
commit42175ea795fa141cd724faf722cdbbd59358ad3c (patch)
tree6172c14eba277d68f1fcec19c4ca570c78f03f88 /linux
parent3c0d4e5fb734b1afe1cd961a4c61b90c8c6d5d9d (diff)
downloadmediapointer-dvb-s2-42175ea795fa141cd724faf722cdbbd59358ad3c.tar.gz
mediapointer-dvb-s2-42175ea795fa141cd724faf722cdbbd59358ad3c.tar.bz2
zoran: if reqbufs is called with count == 0, do a streamoff.
From: Hans Verkuil <hverkuil@xs4all.nl> count == 0 has a special meaning, implement this. Priority: normal Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Diffstat (limited to 'linux')
-rw-r--r--linux/drivers/media/video/zoran/zoran_driver.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/linux/drivers/media/video/zoran/zoran_driver.c b/linux/drivers/media/video/zoran/zoran_driver.c
index 98741c992..e67c6caac 100644
--- a/linux/drivers/media/video/zoran/zoran_driver.c
+++ b/linux/drivers/media/video/zoran/zoran_driver.c
@@ -2494,6 +2494,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;
@@ -2501,17 +2503,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));