diff options
Diffstat (limited to 'linux/drivers/media/dvb/ttpci/av7110_ipack.c')
-rw-r--r-- | linux/drivers/media/dvb/ttpci/av7110_ipack.c | 76 |
1 files changed, 38 insertions, 38 deletions
diff --git a/linux/drivers/media/dvb/ttpci/av7110_ipack.c b/linux/drivers/media/dvb/ttpci/av7110_ipack.c index 805a6453a..b9b978a48 100644 --- a/linux/drivers/media/dvb/ttpci/av7110_ipack.c +++ b/linux/drivers/media/dvb/ttpci/av7110_ipack.c @@ -50,42 +50,42 @@ static void send_ipack(struct ipack *p) int f=0; switch ( p->mpeg ){ - case 2: + case 2: if (p->count < 10) return; p->buf[3] = p->cid; - + p->buf[4] = (u8)(((p->count-6) & 0xFF00) >> 8); p->buf[5] = (u8)((p->count-6) & 0x00FF); if (p->repack_subids && p->cid == PRIVATE_STREAM1){ - + off = 9+p->buf[8]; streamid = p->buf[off]; if ((streamid & 0xF8) == 0x80){ ai.off = 0; - ac3_off = ((p->buf[off+2] << 8)| + ac3_off = ((p->buf[off+2] << 8)| p->buf[off+3]); if (ac3_off < p->count) - f=dvb_filter_get_ac3info(p->buf+off+3+ac3_off, + f=dvb_filter_get_ac3info(p->buf+off+3+ac3_off, p->count-ac3_off, &ai,0); if ( !f ){ - nframes = (p->count-off-3-ac3_off)/ + nframes = (p->count-off-3-ac3_off)/ ai.framesize + 1; p->buf[off+2] = (ac3_off >> 8)& 0xFF; p->buf[off+3] = (ac3_off)& 0xFF; p->buf[off+1] = nframes; - - ac3_off += nframes * ai.framesize - + + ac3_off += nframes * ai.framesize - p->count; } } - } + } p->func(p->buf, p->count, p->data); - + p->buf[6] = 0x80; p->buf[7] = 0x00; p->buf[8] = 0x00; p->count = 9; - if (p->repack_subids && p->cid == PRIVATE_STREAM1 + if (p->repack_subids && p->cid == PRIVATE_STREAM1 && (streamid & 0xF8)==0x80 ){ p->count += 4; p->buf[9] = streamid; @@ -98,11 +98,11 @@ static void send_ipack(struct ipack *p) case 1: if (p->count < 8) return; p->buf[3] = p->cid; - + p->buf[4] = (u8)(((p->count-6) & 0xFF00) >> 8); p->buf[5] = (u8)((p->count-6) & 0x00FF); p->func(p->buf, p->count, p->data); - + p->buf[6] = 0x0F; p->count = 7; break; @@ -191,7 +191,7 @@ int av7110_ipack_instant_repack (const u8 *buf, int count, struct ipack *p) break; } break; - + case 4: if (count-c > 1){ p->plen[0] = buf[c]; @@ -232,7 +232,7 @@ int av7110_ipack_instant_repack (const u8 *buf, int count, struct ipack *p) p->flag2 = buf[c]; c++; p->found++; - } + } break; case 8: @@ -242,7 +242,7 @@ int av7110_ipack_instant_repack (const u8 *buf, int count, struct ipack *p) p->found++; } break; - + default: break; @@ -253,24 +253,24 @@ int av7110_ipack_instant_repack (const u8 *buf, int count, struct ipack *p) if (!p->plength) p->plength = MMAX_PLENGTH-6; - if ( p->done || ((p->mpeg == 2 && p->found >= 9) || + if ( p->done || ((p->mpeg == 2 && p->found >= 9) || (p->mpeg == 1 && p->found >= 7)) ){ switch (p->cid){ - - case AUDIO_STREAM_S ... AUDIO_STREAM_E: + + case AUDIO_STREAM_S ... AUDIO_STREAM_E: case VIDEO_STREAM_S ... VIDEO_STREAM_E: case PRIVATE_STREAM1: - + if (p->mpeg == 2 && p->found == 9) { write_ipack(p, &p->flag1, 1); write_ipack(p, &p->flag2, 1); write_ipack(p, &p->hlength, 1); } - if (p->mpeg == 1 && p->found == 7) + if (p->mpeg == 1 && p->found == 7) write_ipack(p, &p->flag1, 1); - - if (p->mpeg == 2 && (p->flag2 & PTS_ONLY) && + + if (p->mpeg == 2 && (p->flag2 & PTS_ONLY) && p->found < 14) { while (c < count && p->found < 14) { p->pts[p->found-9] = buf[c]; @@ -288,7 +288,7 @@ int av7110_ipack_instant_repack (const u8 *buf, int count, struct ipack *p) p->hlength = 1; } - while (!p->which && c < count && + while (!p->which && c < count && p->check == 0xFF){ p->check = buf[c]; write_ipack(p, buf+c, 1); @@ -296,16 +296,16 @@ int av7110_ipack_instant_repack (const u8 *buf, int count, struct ipack *p) p->found++; p->hlength++; } - + if ( c == count) return count; - + if ( (p->check & 0xC0) == 0x40 && !p->which){ p->check = buf[c]; write_ipack(p, buf+c, 1); c++; p->found++; p->hlength++; - + p->which = 1; if ( c == count) return count; p->check = buf[c]; @@ -316,7 +316,7 @@ int av7110_ipack_instant_repack (const u8 *buf, int count, struct ipack *p) p->which = 2; if ( c == count) return count; } - + if (p->which == 1){ p->check = buf[c]; write_ipack(p, buf+c, 1); @@ -326,18 +326,18 @@ int av7110_ipack_instant_repack (const u8 *buf, int count, struct ipack *p) p->which = 2; if ( c == count) return count; } - + if ( (p->check & 0x30) && p->check != 0xFF){ p->flag2 = (p->check & 0xF0) << 2; p->pts[0] = p->check; p->which = 3; - } - + } + if ( c == count) return count; if (p->which > 2){ if ((p->flag2 & PTS_DTS_FLAGS) == PTS_ONLY){ - while (c < count && + while (c < count && p->which < 7){ p->pts[p->which-2] = buf[c]; @@ -348,9 +348,9 @@ int av7110_ipack_instant_repack (const u8 *buf, int count, struct ipack *p) p->hlength++; } if ( c == count) return count; - } else if ((p->flag2 & PTS_DTS_FLAGS) + } else if ((p->flag2 & PTS_DTS_FLAGS) == PTS_DTS){ - while (c < count && + while (c < count && p->which< 12){ if (p->which< 7) p->pts[p->which @@ -366,9 +366,9 @@ int av7110_ipack_instant_repack (const u8 *buf, int count, struct ipack *p) } p->which = 2000; } - + } - + while (c < count && p->found < p->plength+6){ l = count -c; if (l+p->found > p->plength+6) @@ -376,8 +376,8 @@ int av7110_ipack_instant_repack (const u8 *buf, int count, struct ipack *p) write_ipack(p, buf+c, l); p->found += l; c += l; - } - + } + break; } |