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

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Linux Kernel Mailing List
Date: Monday, October 13, 2008 - 3:17 pm

Gitweb:     http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=a3a584...
Commit:     a3a58467db3c90a1e289970ef319c7abb90be617
Parent:     b1043e562ec9e5fe60af85b3a7eea43e77a35994
Author:     Frank Zago <frank@zago.net>
AuthorDate: Tue Sep 30 03:55:33 2008 -0300
Committer:  Mauro Carvalho Chehab <mchehab@redhat.com>
CommitDate: Sun Oct 12 09:37:13 2008 -0200

    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>
---
 drivers/media/video/gspca/finepix.c |   21 +++++++++++----------
 1 files changed, 11 insertions(+), 10 deletions(-)

diff --git a/drivers/media/video/gspca/finepix.c b/drivers/media/video/gspca/finepix.c
index f75db95..65d3cbf 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)
 		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);
 		}
--
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
V4L/DVB (9090): gspca: Restart the state machine when no f ..., Linux Kernel Mailing ..., (Mon Oct 13, 3:17 pm)