summaryrefslogtreecommitdiff
path: root/drivers/media/video/gspca
diff options
context:
space:
mode:
authorJean-François Moine <moinejf@free.fr>2010-10-16 20:59:13 +0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-10-21 13:55:51 +0400
commit2e0544a8ac5d96efc17bab94f08957ce0efb1220 (patch)
treedf979c52ee7d1e3ea5b29c89b0591f3b5327668c /drivers/media/video/gspca
parent3e9c2b8477059c3ae39ed9373fddd23e4c754acc (diff)
downloadlinux-2e0544a8ac5d96efc17bab94f08957ce0efb1220.tar.xz
[media] gspca - main: Have discontinuous sequence numbers when frames are lost
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>
Diffstat (limited to 'drivers/media/video/gspca')
-rw-r--r--drivers/media/video/gspca/gspca.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/media/video/gspca/gspca.c b/drivers/media/video/gspca/gspca.c
index 68b58106e4c8..0fb48c02bf52 100644
--- a/drivers/media/video/gspca/gspca.c
+++ b/drivers/media/video/gspca/gspca.c
@@ -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 {