From 832d0a9130c18b9ee4b671c46763b972eb2a2568 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jean-Fran=C3=A7ois=20Moine?= Date: Fri, 9 Apr 2010 06:07:58 -0300 Subject: [PATCH] V4L/DVB: gspca - main: Restart streaming after reqbuf MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jean-François Moine Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/gspca/gspca.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/media/video/gspca/gspca.c b/drivers/media/video/gspca/gspca.c index 4fb031cfb64f..9c9d7ea7e626 100644 --- a/drivers/media/video/gspca/gspca.c +++ b/drivers/media/video/gspca/gspca.c @@ -1503,7 +1503,7 @@ static int vidioc_reqbufs(struct file *file, void *priv, struct v4l2_requestbuffers *rb) { struct gspca_dev *gspca_dev = priv; - int i, ret = 0; + int i, ret = 0, streaming; switch (rb->memory) { case GSPCA_MEMORY_READ: /* (internal call) */ @@ -1538,7 +1538,8 @@ static int vidioc_reqbufs(struct file *file, void *priv, } /* stop streaming */ - if (gspca_dev->streaming) { + streaming = gspca_dev->streaming; + if (streaming) { mutex_lock(&gspca_dev->usb_lock); gspca_dev->usb_err = 0; gspca_stream_off(gspca_dev); @@ -1557,6 +1558,8 @@ static int vidioc_reqbufs(struct file *file, void *priv, if (ret == 0) { rb->count = gspca_dev->nframes; gspca_dev->capt_file = file; + if (streaming) + ret = gspca_init_transfer(gspca_dev); } out: mutex_unlock(&gspca_dev->queue_lock); -- 2.30.2