aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/gspca
diff options
context:
space:
mode:
authorFrank Zago <frank@zago.net>2008-09-30 02:55:33 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2008-10-12 07:37:13 -0400
commita3a58467db3c90a1e289970ef319c7abb90be617 (patch)
treeadf9a6c279483fa0b61cae7e8c6d20e74d1d5732 /drivers/media/video/gspca
parentb1043e562ec9e5fe60af85b3a7eea43e77a35994 (diff)
V4L/DVB (9090): gspca: Restart the state machine when no frame buffer in finepix.
Signed-off-by: Frank Zago <frank@zago.net> Signed-off-by: Jean-Francois 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/finepix.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/drivers/media/video/gspca/finepix.c b/drivers/media/video/gspca/finepix.c
index f75db9585f07..65d3cbfe6b27 100644
--- a/drivers/media/video/gspca/finepix.c
+++ b/drivers/media/video/gspca/finepix.c
@@ -135,10 +135,8 @@ static void urb_callback(struct urb *urb)
135 struct gspca_frame *frame; 135 struct gspca_frame *frame;
136 136
137 frame = gspca_get_i_frame(&dev->gspca_dev); 137 frame = gspca_get_i_frame(&dev->gspca_dev);
138 if (frame == NULL) { 138 if (frame == NULL)
139 gspca_dev->last_packet_type = DISCARD_PACKET; 139 gspca_dev->last_packet_type = DISCARD_PACKET;
140 break;
141 }
142 if (urb->actual_length < FPIX_MAX_TRANSFER || 140 if (urb->actual_length < FPIX_MAX_TRANSFER ||
143 (data[urb->actual_length-2] == 0xff && 141 (data[urb->actual_length-2] == 0xff &&
144 data[urb->actual_length-1] == 0xd9)) { 142 data[urb->actual_length-1] == 0xd9)) {
@@ -149,18 +147,21 @@ static void urb_callback(struct urb *urb)
149 * but there's nothing we can do. We also end 147 * but there's nothing we can do. We also end
150 * here if the the jpeg ends right at the end 148 * here if the the jpeg ends right at the end
151 * of the frame. */ 149 * of the frame. */
152 gspca_frame_add(gspca_dev, LAST_PACKET, 150 if (frame)
153 frame, 151 gspca_frame_add(gspca_dev, LAST_PACKET,
154 data, urb->actual_length); 152 frame,
153 data, urb->actual_length);
155 dev_new_state(FPIX_REQ_FRAME); 154 dev_new_state(FPIX_REQ_FRAME);
156 schedule_delayed_work(&dev->wqe, NEXT_FRAME_DELAY); 155 schedule_delayed_work(&dev->wqe, NEXT_FRAME_DELAY);
157 } else { 156 } else {
158 157
159 /* got a partial image */ 158 /* got a partial image */
160 gspca_frame_add(gspca_dev, 159 if (frame)
161 gspca_dev->last_packet_type == LAST_PACKET 160 gspca_frame_add(gspca_dev,
162 ? FIRST_PACKET : INTER_PACKET, 161 gspca_dev->last_packet_type
163 frame, 162 == LAST_PACKET
163 ? FIRST_PACKET : INTER_PACKET,
164 frame,
164 data, urb->actual_length); 165 data, urb->actual_length);
165 read_frame_part(dev); 166 read_frame_part(dev);
166 } 167 }