Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 174048
b: refs/heads/master
c: a6b69e4
h: refs/heads/master
v: v3
  • Loading branch information
Marton Nemeth authored and Mauro Carvalho Chehab committed Dec 5, 2009
1 parent da4c662 commit 6ef4d2b
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c86c82b74f800486ede57fdd5a4fa77d86368861
refs/heads/master: a6b69e409a41144c24dcbecdc174a5c847631de2
3 changes: 2 additions & 1 deletion trunk/drivers/media/video/gspca/mr97310a.c
Original file line number Diff line number Diff line change
Expand Up @@ -1034,9 +1034,10 @@ static void sd_pkt_scan(struct gspca_dev *gspca_dev,
__u8 *data, /* isoc packet */
int len) /* iso packet length */
{
struct sd *sd = (struct sd *) gspca_dev;
unsigned char *sof;

sof = pac_find_sof(gspca_dev, data, len);
sof = pac_find_sof(&sd->sof_read, data, len);
if (sof) {
int n;

Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/media/video/gspca/pac207.c
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ static void sd_pkt_scan(struct gspca_dev *gspca_dev,
struct sd *sd = (struct sd *) gspca_dev;
unsigned char *sof;

sof = pac_find_sof(gspca_dev, data, len);
sof = pac_find_sof(&sd->sof_read, data, len);
if (sof) {
int n;

Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/media/video/gspca/pac7311.c
Original file line number Diff line number Diff line change
Expand Up @@ -838,7 +838,7 @@ static void sd_pkt_scan(struct gspca_dev *gspca_dev,
struct sd *sd = (struct sd *) gspca_dev;
unsigned char *sof;

sof = pac_find_sof(gspca_dev, data, len);
sof = pac_find_sof(&sd->sof_read, data, len);
if (sof) {
unsigned char tmpbuf[4];
int n, lum_offset, footer_length;
Expand Down
27 changes: 13 additions & 14 deletions trunk/drivers/media/video/gspca/pac_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,42 +72,41 @@ static const unsigned char pac_sof_marker[5] =
+----------+
*/

static unsigned char *pac_find_sof(struct gspca_dev *gspca_dev,
static unsigned char *pac_find_sof(u8 *sof_read,
unsigned char *m, int len)
{
struct sd *sd = (struct sd *) gspca_dev;
int i;

/* Search for the SOF marker (fixed part) in the header */
for (i = 0; i < len; i++) {
switch (sd->sof_read) {
switch (*sof_read) {
case 0:
if (m[i] == 0xff)
sd->sof_read = 1;
*sof_read = 1;
break;
case 1:
if (m[i] == 0xff)
sd->sof_read = 2;
*sof_read = 2;
else
sd->sof_read = 0;
*sof_read = 0;
break;
case 2:
switch (m[i]) {
case 0x00:
sd->sof_read = 3;
*sof_read = 3;
break;
case 0xff:
/* stay in this state */
break;
default:
sd->sof_read = 0;
*sof_read = 0;
}
break;
case 3:
if (m[i] == 0xff)
sd->sof_read = 4;
*sof_read = 4;
else
sd->sof_read = 0;
*sof_read = 0;
break;
case 4:
switch (m[i]) {
Expand All @@ -117,18 +116,18 @@ static unsigned char *pac_find_sof(struct gspca_dev *gspca_dev,
"SOF found, bytes to analyze: %u."
" Frame starts at byte #%u",
len, i + 1);
sd->sof_read = 0;
*sof_read = 0;
return m + i + 1;
break;
case 0xff:
sd->sof_read = 2;
*sof_read = 2;
break;
default:
sd->sof_read = 0;
*sof_read = 0;
}
break;
default:
sd->sof_read = 0;
*sof_read = 0;
}
}

Expand Down

0 comments on commit 6ef4d2b

Please sign in to comment.