--- multiplexer/splicets.c 2001/08/08 09:59:58 1.16 +++ multiplexer/splicets.c 2001/08/08 16:52:15 1.17 @@ -430,6 +430,7 @@ static int make_patsection (int section, { int i; byte *d; + prog_descr *p; d = dest; *d++ = TS_TABLEID_PAT; d += 2; @@ -440,12 +441,13 @@ static int make_patsection (int section, *d++ = last_patsection; i = progs; while (--i >= 0) { - if (prog[i]->pat_section == section) { + p = prog[i]; + if (p->pat_section == section) { int x; - x = prog[i]->program_number; + x = p->program_number; *d++ = (x >> 8); *d++ = x; - x = prog[i]->pmt_pid; + x = p->pmt_pid; *d++ = 0xE0 | (x >> 8); *d++ = x; } @@ -464,6 +466,7 @@ static int make_pmtsection (stream_descr int i; byte *d; stump_descr *st; + stream_descr *t; d = dest; *d++ = TS_TABLEID_PMT; d += 2; @@ -489,7 +492,7 @@ static int make_pmtsection (stream_descr *d++ = i; d += 2; i = NUMBER_DESCR; - while (--i > 0) { + while (--i >= 0) { byte *y; y = p->manudescr.refx[i]; if ((y == NULL) @@ -510,21 +513,22 @@ static int make_pmtsection (stream_descr dest[TS_PMT_PILEN+1] = i; i = p->streams; while (--i >= 0) { - if (p->stream[i]->u.d.mention) { + t = p->stream[i]; + if (t->u.d.mention) { int x; byte *e; - *d++ = p->stream[i]->stream_type; - x = p->stream[i]->u.d.pid; + *d++ = t->stream_type; + x = t->u.d.pid; *d++ = 0xE0 | (x >> 8); *d++ = x; d += 2; e = d; x = NUMBER_DESCR; - while (--x > 0) { + while (--x >= 0) { byte *y; - y = p->stream[i]->manudescr->refx[x]; + y = t->manudescr->refx[x]; if (y == NULL) { - y = p->stream[i]->autodescr->refx[x]; + y = t->autodescr->refx[x]; } if (y != NULL) { int yl = y[1]; @@ -551,7 +555,7 @@ static int make_pmtsection (stream_descr d += 2; e = d; x = NUMBER_DESCR; - while (--x > 0) { + while (--x >= 0) { byte *y; y = st->manudescr.refx[x]; if (y != NULL) { @@ -835,7 +839,7 @@ static byte *procdata_syn_adaptfield (st *d++ = adapt_flags1; if (adapt_flags1 & TS_ADAPT_PCRFLAG) { clockref pcr; - msec2cref (&s->u.d.conv,c->msecpush + s->u.d.delta,&pcr); + msec2cref (&s->u.d.conv, c->msecpush + s->u.d.delta, &pcr); *d++ = (pcr.base >> 25) | (pcr.ba33 << 7); *d++ = pcr.base >> 17; *d++ = pcr.base >> 9; @@ -943,8 +947,7 @@ static stream_descr *procdata_syn_payloa static void proc_unparsedsi (stream_descr *s, byte *d) { - warn (LINF,"Splice Unparsed SI",ETSC,10,s->streamdata,s->u.usi.delta); - warn (LDEB,"Splice Unparsed SI",ETSC,10,s->stream_id,s->sourceid); + warn (LINF,"Splice Unparsed SI",ETSC,10,s->sourceid,s->streamdata); memcpy (d,&s->data.ptr[s->ctrl.ptr[s->ctrl.out].index],TS_PACKET_SIZE); /* check if == s->ctrl.ptr[s->ctrl.out].length); ? */ list_incr (s->ctrl.out,s->ctrl,1); @@ -973,7 +976,7 @@ stream_descr *process_something (stream_ case sd_data: c = &s->ctrl.ptr[s->ctrl.out]; procdata_check_psi (&pid, &scramble, &size, s, c); - d = output_pushdata (TS_PACKET_SIZE,c->msecpush + s->u.d.delta); + d = output_pushdata (TS_PACKET_SIZE, TRUE, c->msecpush + s->u.d.delta); if (d == NULL) { return (s); } @@ -992,7 +995,7 @@ stream_descr *process_something (stream_ break; case sd_unparsedsi: c = &s->ctrl.ptr[s->ctrl.out]; - d = output_pushdata (TS_PACKET_SIZE,c->msecpush + s->u.usi.delta); + d = output_pushdata (TS_PACKET_SIZE, FALSE, 0); if (d == NULL) { return (s); }