[media] gspca: reset image_len to 0 on LAST_PACKET when discarding frame
authorHans de Goede <hdegoede@redhat.com>
Sun, 5 Jun 2011 06:44:43 +0000 (03:44 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Wed, 27 Jul 2011 20:53:39 +0000 (17:53 -0300)
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 <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/video/gspca/gspca.c

index d0b79a9f88b7f4aa67231ebde293eb0968f51e28..d94c108dd8dcf224dd5746b9fcf4d34cc4a8b60a 100644 (file)
@@ -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;