Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 97739
b: refs/heads/master
c: a230e55
h: refs/heads/master
i:
  97737: bb752d4
  97735: e544e3a
v: v3
  • Loading branch information
Al Viro authored and Mauro Carvalho Chehab committed Jun 5, 2008
1 parent 2c1cb68 commit 8829fb0
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 8 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: f34ec12a17984d7df784bf49caf64f5f743e5e10
refs/heads/master: a230e55d92347e09d9ba2e97096df114b2dfaf2d
34 changes: 27 additions & 7 deletions trunk/drivers/media/dvb/ttpci/av7110_av.c
Original file line number Diff line number Diff line change
Expand Up @@ -965,8 +965,9 @@ static u8 iframe_header[] = { 0x00, 0x00, 0x01, 0xe0, 0x00, 0x00, 0x80, 0x00, 0x

static int play_iframe(struct av7110 *av7110, char __user *buf, unsigned int len, int nonblock)
{
int i, n;
unsigned i, n;
int progressive = 0;
int match = 0;

dprintk(2, "av7110:%p, \n", av7110);

Expand All @@ -975,12 +976,31 @@ static int play_iframe(struct av7110 *av7110, char __user *buf, unsigned int len
return -EBUSY;
}

for (i = 0; i < len - 5; i++) {
/* get progressive flag from picture extension */
if (buf[i] == 0x00 && buf[i+1] == 0x00 &&
buf[i+2] == 0x01 && (unsigned char)buf[i+3] == 0xb5 &&
(buf[i+4] & 0xf0) == 0x10)
progressive = buf[i+5] & 0x08;
/* search in buf for instances of 00 00 01 b5 1? */
for (i = 0; i < len; i++) {
unsigned char c;
if (get_user(c, buf + i))
return -EFAULT;
if (match == 5) {
progressive = c & 0x08;
match = 0;
}
if (c == 0x00) {
match = (match == 1 || match == 2) ? 2 : 1;
continue;
}
switch (match++) {
case 2: if (c == 0x01)
continue;
break;
case 3: if (c == 0xb5)
continue;
break;
case 4: if ((c & 0xf0) == 0x10)
continue;
break;
}
match = 0;
}

/* setting n always > 1, fixes problems when playing stillframes
Expand Down

0 comments on commit 8829fb0

Please sign in to comment.