From fa4376d28e19b0835f948c5b42f13738f68bd9a1 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Sun, 5 Jun 2011 03:44:43 -0300 Subject: [media] gspca: reset image_len to 0 on LAST_PACKET when discarding frame Reset image and image_len to NULL/0 on LAST_PACKET when we're in discard frame mode, just like we do when not discarding the current frame. The new se401 driver uses image_len for SOF/EOF detection and thus depends on this. Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/gspca/gspca.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/media/video/gspca/gspca.c b/drivers/media/video/gspca/gspca.c index d0b79a9f88b..d94c108dd8d 100644 --- a/drivers/media/video/gspca/gspca.c +++ b/drivers/media/video/gspca/gspca.c @@ -443,8 +443,11 @@ void gspca_frame_add(struct gspca_dev *gspca_dev, } else { switch (gspca_dev->last_packet_type) { case DISCARD_PACKET: - if (packet_type == LAST_PACKET) + if (packet_type == LAST_PACKET) { gspca_dev->last_packet_type = packet_type; + gspca_dev->image = NULL; + gspca_dev->image_len = 0; + } return; case LAST_PACKET: return; -- cgit v1.2.3-70-g09d2