diff options
author | Jean-François Moine <moinejf@free.fr> | 2010-10-16 12:59:13 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-10-21 05:55:51 -0400 |
commit | 2e0544a8ac5d96efc17bab94f08957ce0efb1220 (patch) | |
tree | df979c52ee7d1e3ea5b29c89b0591f3b5327668c /drivers/media/video/gspca | |
parent | 3e9c2b8477059c3ae39ed9373fddd23e4c754acc (diff) |
[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.c | 3 |
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, | |||
432 | /* if there are no queued buffer, discard the whole frame */ | 432 | /* if there are no queued buffer, discard the whole frame */ |
433 | if (i == atomic_read(&gspca_dev->fr_q)) { | 433 | if (i == atomic_read(&gspca_dev->fr_q)) { |
434 | gspca_dev->last_packet_type = DISCARD_PACKET; | 434 | gspca_dev->last_packet_type = DISCARD_PACKET; |
435 | gspca_dev->sequence++; | ||
435 | return; | 436 | return; |
436 | } | 437 | } |
437 | j = gspca_dev->fr_queue[i]; | 438 | j = gspca_dev->fr_queue[i]; |
438 | frame = &gspca_dev->frame[j]; | 439 | frame = &gspca_dev->frame[j]; |
439 | frame->v4l2_buf.timestamp = ktime_to_timeval(ktime_get()); | 440 | frame->v4l2_buf.timestamp = ktime_to_timeval(ktime_get()); |
440 | frame->v4l2_buf.sequence = ++gspca_dev->sequence; | 441 | frame->v4l2_buf.sequence = gspca_dev->sequence++; |
441 | gspca_dev->image = frame->data; | 442 | gspca_dev->image = frame->data; |
442 | gspca_dev->image_len = 0; | 443 | gspca_dev->image_len = 0; |
443 | } else { | 444 | } else { |