V4L/DVB (13816): gspca - main: Set the current frame pointer when first qbuf.
authorJean-Francois Moine <moinejf@free.fr>
Mon, 14 Dec 2009 17:57:49 +0000 (14:57 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Sun, 17 Jan 2010 13:31:34 +0000 (11:31 -0200)
When not set, some images could be lost.

Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/video/gspca/gspca.c

index e930a67..bd6214d 100644 (file)
@@ -1815,6 +1815,8 @@ static int vidioc_qbuf(struct file *file, void *priv,
        /* put the buffer in the 'queued' queue */
        i = gspca_dev->fr_q;
        gspca_dev->fr_queue[i] = index;
+       if (gspca_dev->fr_i == i)
+               gspca_dev->cur_frame = frame;
        gspca_dev->fr_q = (i + 1) % gspca_dev->nframes;
        PDEBUG(D_FRAM, "qbuf q:%d i:%d o:%d",
                gspca_dev->fr_q,