From: Jean-François Moine Date: Sat, 16 Oct 2010 16:59:13 +0000 (-0300) Subject: [media] gspca - main: Have discontinuous sequence numbers when frames are lost X-Git-Tag: v3.0~2969^2~118 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2e0544a8ac5d96efc17bab94f08957ce0efb1220;p=platform%2Fkernel%2Flinux-amlogic.git [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 Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/video/gspca/gspca.c b/drivers/media/video/gspca/gspca.c index 68b5810..0fb48c0 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 {