summaryrefslogtreecommitdiff
path: root/linux
diff options
context:
space:
mode:
authorJean-Francois Moine <moinejf@free.fr>2008-09-30 08:55:33 +0200
committerJean-Francois Moine <moinejf@free.fr>2008-09-30 08:55:33 +0200
commit167acb4f34fff2cc1e98ee5146c17bb25401cba2 (patch)
tree92391078414a51b6a942cd016b133b1a846e5c90 /linux
parent37652be2369266834832ee1fccea03b5afac7161 (diff)
downloadmediapointer-dvb-s2-167acb4f34fff2cc1e98ee5146c17bb25401cba2.tar.gz
mediapointer-dvb-s2-167acb4f34fff2cc1e98ee5146c17bb25401cba2.tar.bz2
gspca: Restart the state machine when no frame buffer in finepix.
From: Frank Zago <frank@zago.net> Priority: normal Signed-off-by: Frank Zago <frank@zago.net> Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Diffstat (limited to 'linux')
-rw-r--r--linux/drivers/media/video/gspca/finepix.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/linux/drivers/media/video/gspca/finepix.c b/linux/drivers/media/video/gspca/finepix.c
index f75db9585..65d3cbfe6 100644
--- a/linux/drivers/media/video/gspca/finepix.c
+++ b/linux/drivers/media/video/gspca/finepix.c
@@ -135,10 +135,8 @@ static void urb_callback(struct urb *urb)
struct gspca_frame *frame;
frame = gspca_get_i_frame(&dev->gspca_dev);
- if (frame == NULL) {
+ if (frame == NULL)
gspca_dev->last_packet_type = DISCARD_PACKET;
- break;
- }
if (urb->actual_length < FPIX_MAX_TRANSFER ||
(data[urb->actual_length-2] == 0xff &&
data[urb->actual_length-1] == 0xd9)) {
@@ -149,18 +147,21 @@ static void urb_callback(struct urb *urb)
* but there's nothing we can do. We also end
* here if the the jpeg ends right at the end
* of the frame. */
- gspca_frame_add(gspca_dev, LAST_PACKET,
- frame,
- data, urb->actual_length);
+ if (frame)
+ gspca_frame_add(gspca_dev, LAST_PACKET,
+ frame,
+ data, urb->actual_length);
dev_new_state(FPIX_REQ_FRAME);
schedule_delayed_work(&dev->wqe, NEXT_FRAME_DELAY);
} else {
/* got a partial image */
- gspca_frame_add(gspca_dev,
- gspca_dev->last_packet_type == LAST_PACKET
- ? FIRST_PACKET : INTER_PACKET,
- frame,
+ if (frame)
+ gspca_frame_add(gspca_dev,
+ gspca_dev->last_packet_type
+ == LAST_PACKET
+ ? FIRST_PACKET : INTER_PACKET,
+ frame,
data, urb->actual_length);
read_frame_part(dev);
}