Commit 832d0a91 authored by Jean-François Moine's avatar Jean-François Moine Committed by Mauro Carvalho Chehab

V4L/DVB: gspca - main: Restart streaming after reqbuf

Signed-off-by: default avatarJean-François Moine <moinejf@free.fr>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 18bf99aa
...@@ -1503,7 +1503,7 @@ static int vidioc_reqbufs(struct file *file, void *priv, ...@@ -1503,7 +1503,7 @@ static int vidioc_reqbufs(struct file *file, void *priv,
struct v4l2_requestbuffers *rb) struct v4l2_requestbuffers *rb)
{ {
struct gspca_dev *gspca_dev = priv; struct gspca_dev *gspca_dev = priv;
int i, ret = 0; int i, ret = 0, streaming;
switch (rb->memory) { switch (rb->memory) {
case GSPCA_MEMORY_READ: /* (internal call) */ case GSPCA_MEMORY_READ: /* (internal call) */
...@@ -1538,7 +1538,8 @@ static int vidioc_reqbufs(struct file *file, void *priv, ...@@ -1538,7 +1538,8 @@ static int vidioc_reqbufs(struct file *file, void *priv,
} }
/* stop streaming */ /* stop streaming */
if (gspca_dev->streaming) { streaming = gspca_dev->streaming;
if (streaming) {
mutex_lock(&gspca_dev->usb_lock); mutex_lock(&gspca_dev->usb_lock);
gspca_dev->usb_err = 0; gspca_dev->usb_err = 0;
gspca_stream_off(gspca_dev); gspca_stream_off(gspca_dev);
...@@ -1557,6 +1558,8 @@ static int vidioc_reqbufs(struct file *file, void *priv, ...@@ -1557,6 +1558,8 @@ static int vidioc_reqbufs(struct file *file, void *priv,
if (ret == 0) { if (ret == 0) {
rb->count = gspca_dev->nframes; rb->count = gspca_dev->nframes;
gspca_dev->capt_file = file; gspca_dev->capt_file = file;
if (streaming)
ret = gspca_init_transfer(gspca_dev);
} }
out: out:
mutex_unlock(&gspca_dev->queue_lock); mutex_unlock(&gspca_dev->queue_lock);
......
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