3 #include <linux/string.h>
44 static void send_ipack(
struct ipack *p)
58 p->
buf[4] = (
u8)(((p->
count - 6) & 0xff00) >> 8);
63 if ((streamid & 0xf8) == 0x80) {
65 ac3_off = ((p->
buf[off + 2] << 8)|
67 if (ac3_off < p->
count)
69 p->
count - ac3_off, &ai, 0);
71 nframes = (p->
count - off - 3 - ac3_off) /
73 p->
buf[off + 2] = (ac3_off >> 8) & 0xff;
74 p->
buf[off + 3] = (ac3_off) & 0xff;
75 p->
buf[off + 1] = nframes;
76 ac3_off += nframes * ai.framesize - p->
count;
87 && (streamid & 0xf8) == 0x80) {
90 p->
buf[10] = (ac3_off >> 8) & 0xff;
91 p->
buf[11] = (ac3_off) & 0xff;
100 p->
buf[4] = (
u8)(((p->
count - 6) & 0xff00) >> 8);
124 u8 headr[3] = { 0x00, 0x00, 0x01 };
131 if (p->
count + count < p->size){
139 if (count - rest > 0)
140 write_ipack(p, data + rest, count - rest);
150 while (c < count && (p->
mpeg == 0 ||
166 else if (buf[c] == 0)
223 if ((p->
flag1 & 0xc0) == 0x80)
265 write_ipack(p, &p->
flag1, 1);
266 write_ipack(p, &p->
flag2, 1);
267 write_ipack(p, &p->
hlength, 1);
271 write_ipack(p, &p->
flag1, 1);
275 while (c < count && p->found < 14) {
277 write_ipack(p,
buf +
c, 1);
292 while (!p->
which &&
c < count &&
295 write_ipack(p,
buf +
c, 1);
306 write_ipack(p,
buf +
c, 1);
315 write_ipack(p,
buf +
c, 1);
326 write_ipack(p,
buf +
c, 1);
345 while (c < count && p->which < 7) {
347 write_ipack(p,
buf +
c, 1);
356 while (c < count && p->which < 12) {
359 write_ipack(p,
buf +
c, 1);
373 while (c < count && p->found < p->plength + 6) {
377 write_ipack(p,
buf + c,
l);
386 if (p->
found + count - c < p->plength + 6) {