Skip to content

Commit

Permalink
V4L/DVB: gspca - main: Restart streaming after reqbuf
Browse files Browse the repository at this point in the history
Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
  • Loading branch information
Jean-François Moine authored and Mauro Carvalho Chehab committed May 19, 2010
1 parent 18bf99a commit 832d0a9
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions drivers/media/video/gspca/gspca.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) */
Expand Down Expand Up @@ -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);
Expand All @@ -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);
Expand Down

0 comments on commit 832d0a9

Please sign in to comment.