Commit a3a58467 authored by Frank Zago's avatar Frank Zago Committed by Mauro Carvalho Chehab

V4L/DVB (9090): gspca: Restart the state machine when no frame buffer in finepix.

Signed-off-by: default avatarFrank Zago <frank@zago.net>
Signed-off-by: default avatarJean-Francois Moine <moinejf@free.fr>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent b1043e56
...@@ -135,10 +135,8 @@ static void urb_callback(struct urb *urb) ...@@ -135,10 +135,8 @@ static void urb_callback(struct urb *urb)
struct gspca_frame *frame; struct gspca_frame *frame;
frame = gspca_get_i_frame(&dev->gspca_dev); frame = gspca_get_i_frame(&dev->gspca_dev);
if (frame == NULL) { if (frame == NULL)
gspca_dev->last_packet_type = DISCARD_PACKET; gspca_dev->last_packet_type = DISCARD_PACKET;
break;
}
if (urb->actual_length < FPIX_MAX_TRANSFER || if (urb->actual_length < FPIX_MAX_TRANSFER ||
(data[urb->actual_length-2] == 0xff && (data[urb->actual_length-2] == 0xff &&
data[urb->actual_length-1] == 0xd9)) { data[urb->actual_length-1] == 0xd9)) {
...@@ -149,6 +147,7 @@ static void urb_callback(struct urb *urb) ...@@ -149,6 +147,7 @@ static void urb_callback(struct urb *urb)
* but there's nothing we can do. We also end * but there's nothing we can do. We also end
* here if the the jpeg ends right at the end * here if the the jpeg ends right at the end
* of the frame. */ * of the frame. */
if (frame)
gspca_frame_add(gspca_dev, LAST_PACKET, gspca_frame_add(gspca_dev, LAST_PACKET,
frame, frame,
data, urb->actual_length); data, urb->actual_length);
...@@ -157,8 +156,10 @@ static void urb_callback(struct urb *urb) ...@@ -157,8 +156,10 @@ static void urb_callback(struct urb *urb)
} else { } else {
/* got a partial image */ /* got a partial image */
if (frame)
gspca_frame_add(gspca_dev, gspca_frame_add(gspca_dev,
gspca_dev->last_packet_type == LAST_PACKET gspca_dev->last_packet_type
== LAST_PACKET
? FIRST_PACKET : INTER_PACKET, ? FIRST_PACKET : INTER_PACKET,
frame, frame,
data, urb->actual_length); data, urb->actual_length);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment