]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commitdiff
[media] gspca - main: Have discontinuous sequence numbers when frames are lost
authorJean-François Moine <moinejf@free.fr>
Sat, 16 Oct 2010 16:59:13 +0000 (13:59 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Thu, 21 Oct 2010 09:55:51 +0000 (07:55 -0200)
This patch also sets to 0 the sequence of the first frame.

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

index 68b58106e4c8ca28c9c803daefdc531a507183c6..0fb48c02bf527bc358c35f9cfe3da0c26347d659 100644 (file)
@@ -432,12 +432,13 @@ void gspca_frame_add(struct gspca_dev *gspca_dev,
                /* if there are no queued buffer, discard the whole frame */
                if (i == atomic_read(&gspca_dev->fr_q)) {
                        gspca_dev->last_packet_type = DISCARD_PACKET;
+                       gspca_dev->sequence++;
                        return;
                }
                j = gspca_dev->fr_queue[i];
                frame = &gspca_dev->frame[j];
                frame->v4l2_buf.timestamp = ktime_to_timeval(ktime_get());
-               frame->v4l2_buf.sequence = ++gspca_dev->sequence;
+               frame->v4l2_buf.sequence = gspca_dev->sequence++;
                gspca_dev->image = frame->data;
                gspca_dev->image_len = 0;
        } else {