The patch number 10713 was added via Hans Verkuil <[email protected]>
to http://linuxtv.org/hg/v4l-dvb master development tree.

Kernel patches in this development tree may be modified to be backward
compatible with older kernels. Compatibility modifications will be
removed before inclusion into the mainstream Kernel

If anyone has any objections, please let us know by sending a message to:
        Linux Media Mailing List <[email protected]>

------

From: Hans Verkuil  <[email protected]>
zoran: if reqbufs is called with count == 0, do a streamoff.


count == 0 has a special meaning, implement this.

Priority: normal

Signed-off-by: Hans Verkuil <[email protected]>


---

 linux/drivers/media/video/zoran/zoran_driver.c |   10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff -r e87f288d40bb -r 24c9a289c40f 
linux/drivers/media/video/zoran/zoran_driver.c
--- a/linux/drivers/media/video/zoran/zoran_driver.c    Wed Feb 18 21:12:34 
2009 +0100
+++ b/linux/drivers/media/video/zoran/zoran_driver.c    Wed Feb 18 21:15:46 
2009 +0100
@@ -2494,6 +2494,8 @@ static int zoran_overlay(struct file *fi
        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 *fi
        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;
        }
 
+       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));


---

Patch is available at: 
http://linuxtv.org/hg/v4l-dvb/rev/24c9a289c40fa47fd14264e223f19392135ceca6

_______________________________________________
linuxtv-commits mailing list
[email protected]
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits

Reply via email to