Commit ebb78c5a authored by Jean-François Moine's avatar Jean-François Moine Committed by Mauro Carvalho Chehab

V4L/DVB: gspca - t613: Simplify the scan of isoc packets

Signed-off-by: default avatarJean-François Moine <moinejf@free.fr>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 98388241
...@@ -1080,7 +1080,7 @@ static void sd_pkt_scan(struct gspca_dev *gspca_dev, ...@@ -1080,7 +1080,7 @@ static void sd_pkt_scan(struct gspca_dev *gspca_dev,
u8 *data, /* isoc packet */ u8 *data, /* isoc packet */
int len) /* iso packet length */ int len) /* iso packet length */
{ {
static u8 ffd9[] = { 0xff, 0xd9 }; int pkt_type;
if (data[0] == 0x5a) { if (data[0] == 0x5a) {
/* Control Packet, after this came the header again, /* Control Packet, after this came the header again,
...@@ -1090,22 +1090,13 @@ static void sd_pkt_scan(struct gspca_dev *gspca_dev, ...@@ -1090,22 +1090,13 @@ static void sd_pkt_scan(struct gspca_dev *gspca_dev,
} }
data += 2; data += 2;
len -= 2; len -= 2;
if (data[0] == 0xff && data[1] == 0xd8) { if (data[0] == 0xff && data[1] == 0xd8)
/* extra bytes....., could be processed too but would be pkt_type = FIRST_PACKET;
* a waste of time, right now leave the application and else if (data[len - 2] == 0xff && data[len - 1] == 0xd9)
* libjpeg do it for ourserlves.. */ pkt_type = LAST_PACKET;
gspca_frame_add(gspca_dev, LAST_PACKET, else
ffd9, 2); pkt_type = INTER_PACKET;
gspca_frame_add(gspca_dev, FIRST_PACKET, data, len); gspca_frame_add(gspca_dev, pkt_type, data, len);
return;
}
if (data[len - 2] == 0xff && data[len - 1] == 0xd9) {
/* Just in case, i have seen packets with the marker,
* other's do not include it... */
len -= 2;
}
gspca_frame_add(gspca_dev, INTER_PACKET, data, len);
} }
......
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