Skip to content

Commit

Permalink
[media] gspca: reset image_len to 0 on LAST_PACKET when discarding frame
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Hans de Goede authored and Mauro Carvalho Chehab committed Jul 27, 2011
1 parent 21144ea commit fa4376d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion drivers/media/video/gspca/gspca.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit fa4376d

Please sign in to comment.