diff options
author | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-05-09 06:34:19 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-05-09 06:34:19 -0300 |
commit | ef9ce811383b9e45d06ed6728a8ef0491ba5e16c (patch) | |
tree | 2d40b41d578521602c2b3e920d77c222d17770cf /linux/drivers/media/video/gspca/sunplus.c | |
parent | 07aa0071b7731c08909ed2ea7ab99a62fa934ff0 (diff) | |
parent | fd22f9f82432e1d80c92bd020d5a9374c13125e3 (diff) | |
download | mediapointer-dvb-s2-ef9ce811383b9e45d06ed6728a8ef0491ba5e16c.tar.gz mediapointer-dvb-s2-ef9ce811383b9e45d06ed6728a8ef0491ba5e16c.tar.bz2 |
merge: http://linuxtv.org/hg/~jfrancois/v4l-dvb
From: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'linux/drivers/media/video/gspca/sunplus.c')
-rw-r--r-- | linux/drivers/media/video/gspca/sunplus.c | 33 |
1 files changed, 13 insertions, 20 deletions
diff --git a/linux/drivers/media/video/gspca/sunplus.c b/linux/drivers/media/video/gspca/sunplus.c index 428b1e2b7..16bc65dc7 100644 --- a/linux/drivers/media/video/gspca/sunplus.c +++ b/linux/drivers/media/video/gspca/sunplus.c @@ -32,9 +32,6 @@ MODULE_LICENSE("GPL"); struct sd { struct gspca_dev gspca_dev; /* !! must be the first item */ - __u8 packet[ISO_MAX_SIZE + 128]; - /* !! no more than 128 ff in an ISO packet */ - unsigned char brightness; unsigned char contrast; unsigned char colors; @@ -1134,7 +1131,6 @@ static void sd_pkt_scan(struct gspca_dev *gspca_dev, { struct sd *sd = (struct sd *) gspca_dev; int i, sof = 0; - unsigned char *s, *d; static unsigned char ffd9[] = {0xff, 0xd9}; /* frames are jpeg 4.1.1 without 0xff escape */ @@ -1208,22 +1204,19 @@ static void sd_pkt_scan(struct gspca_dev *gspca_dev, } /* add 0x00 after 0xff */ - for (i = len; --i >= 0; ) - if (data[i] == 0xff) - break; - if (i < 0) { /* no 0xff */ - gspca_frame_add(gspca_dev, INTER_PACKET, frame, data, len); - return; - } - s = data; - d = sd->packet; - for (i = 0; i < len; i++) { - *d++ = *s++; - if (s[-1] == 0xff) - *d++ = 0x00; - } - gspca_frame_add(gspca_dev, INTER_PACKET, frame, - sd->packet, d - sd->packet); + i = 0; + do { + if (data[i] == 0xff) { + gspca_frame_add(gspca_dev, INTER_PACKET, frame, + data, i + 1); + len -= i; + data += i; + *data = 0x00; + i = 0; + } + i++; + } while (i < len); + gspca_frame_add(gspca_dev, INTER_PACKET, frame, data, len); } static void setbrightness(struct gspca_dev *gspca_dev) |