aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorJean-François Moine <moinejf@free.fr>2010-06-05 05:56:48 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-08-02 13:44:08 -0400
commitebb78c5a81e0f4c85f6d9e1b0d11ede7adb530b3 (patch)
tree10d93756d6026aad05b235ee382670e4435824c8 /drivers
parent983882411b1121557c822887a27aeaa874f51577 (diff)
V4L/DVB: gspca - t613: Simplify the scan of isoc packets
Signed-off-by: Jean-François Moine <moinejf@free.fr> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/media/video/gspca/t613.c25
1 files changed, 8 insertions, 17 deletions
diff --git a/drivers/media/video/gspca/t613.c b/drivers/media/video/gspca/t613.c
index 0cc79e16963f..d9618341ce84 100644
--- a/drivers/media/video/gspca/t613.c
+++ b/drivers/media/video/gspca/t613.c
@@ -1080,7 +1080,7 @@ static void sd_pkt_scan(struct gspca_dev *gspca_dev,
1080 u8 *data, /* isoc packet */ 1080 u8 *data, /* isoc packet */
1081 int len) /* iso packet length */ 1081 int len) /* iso packet length */
1082{ 1082{
1083 static u8 ffd9[] = { 0xff, 0xd9 }; 1083 int pkt_type;
1084 1084
1085 if (data[0] == 0x5a) { 1085 if (data[0] == 0x5a) {
1086 /* Control Packet, after this came the header again, 1086 /* Control Packet, after this came the header again,
@@ -1090,22 +1090,13 @@ static void sd_pkt_scan(struct gspca_dev *gspca_dev,
1090 } 1090 }
1091 data += 2; 1091 data += 2;
1092 len -= 2; 1092 len -= 2;
1093 if (data[0] == 0xff && data[1] == 0xd8) { 1093 if (data[0] == 0xff && data[1] == 0xd8)
1094 /* extra bytes....., could be processed too but would be 1094 pkt_type = FIRST_PACKET;
1095 * a waste of time, right now leave the application and 1095 else if (data[len - 2] == 0xff && data[len - 1] == 0xd9)
1096 * libjpeg do it for ourserlves.. */ 1096 pkt_type = LAST_PACKET;
1097 gspca_frame_add(gspca_dev, LAST_PACKET, 1097 else
1098 ffd9, 2); 1098 pkt_type = INTER_PACKET;
1099 gspca_frame_add(gspca_dev, FIRST_PACKET, data, len); 1099 gspca_frame_add(gspca_dev, pkt_type, data, len);
1100 return;
1101 }
1102
1103 if (data[len - 2] == 0xff && data[len - 1] == 0xd9) {
1104 /* Just in case, i have seen packets with the marker,
1105 * other's do not include it... */
1106 len -= 2;
1107 }
1108 gspca_frame_add(gspca_dev, INTER_PACKET, data, len);
1109} 1100}
1110 1101
1111 1102