Commit 84c1b094 authored by Hans Verkuil's avatar Hans Verkuil Committed by Mauro Carvalho Chehab

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: default avatarHans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 5ca75b00
...@@ -2493,6 +2493,8 @@ static int zoran_overlay(struct file *file, void *__fh, unsigned int on) ...@@ -2493,6 +2493,8 @@ static int zoran_overlay(struct file *file, void *__fh, unsigned int on)
return res; 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) static int zoran_reqbufs(struct file *file, void *__fh, struct v4l2_requestbuffers *req)
{ {
struct zoran_fh *fh = __fh; struct zoran_fh *fh = __fh;
...@@ -2500,17 +2502,19 @@ static int zoran_reqbufs(struct file *file, void *__fh, struct v4l2_requestbuffe ...@@ -2500,17 +2502,19 @@ static int zoran_reqbufs(struct file *file, void *__fh, struct v4l2_requestbuffe
int res = 0; int res = 0;
if (req->memory != V4L2_MEMORY_MMAP) { if (req->memory != V4L2_MEMORY_MMAP) {
dprintk(1, dprintk(2,
KERN_ERR KERN_ERR
"%s: only MEMORY_MMAP capture is supported, not %d\n", "%s: only MEMORY_MMAP capture is supported, not %d\n",
ZR_DEVNAME(zr), req->memory); ZR_DEVNAME(zr), req->memory);
return -EINVAL; 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) { if (fh->v4l_buffers.allocated || fh->jpg_buffers.allocated) {
dprintk(1, dprintk(2,
KERN_ERR KERN_ERR
"%s: VIDIOC_REQBUFS - buffers already allocated\n", "%s: VIDIOC_REQBUFS - buffers already allocated\n",
ZR_DEVNAME(zr)); ZR_DEVNAME(zr));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment