--- multiplexer/splicets.c 2001/08/01 10:27:41 1.14 +++ multiplexer/splicets.c 2001/08/02 14:51:22 1.15 @@ -117,13 +117,13 @@ static int findapid (stream_descr *s) void splice_all_configuration (void) { int i; - if (configuration_on && configuration_changed) { + if (configuration_must_print) { i = progs; fprintf (stderr, configuration_total, i); while (--i >= 0) { splice_one_configuration (prog[i]); } - configuration_changed = FALSE; + configuration_was_printed; } } @@ -236,6 +236,7 @@ void splice_createstump (int programnb, } st->stream_type = styp; clear_descrdescr (&(st->manudescr)); + splice_modifycheckmatch (programnb,p,NULL,st); } stump_descr *splice_getstumps (int programnb, @@ -272,6 +273,27 @@ stump_descr *splice_getstumps (int progr return (rl); } +void splice_modifytargetdescriptor (int programnb, + short sid, + short pid, + int dtag, + int dlength, + byte *data) +{ + int i; + if (programnb < 0) { + i = progs; + while (--i >= 0) { + splice_modifytargetdescrprog (prog[i], + prog[i]->program_number,-1,0,-1,-1,NULL,globalstumps); + } + splice_modifytargetdescrprog (NULL,-1,-1,0,-1,-1,NULL,globalstumps); + } else { + splice_modifytargetdescrprog (splice_getprog (programnb), + programnb,sid,pid,dtag,dlength,data,globalstumps); + } +} + prog_descr *splice_getprog (int programnb) { int i; @@ -303,9 +325,11 @@ prog_descr *splice_openprog (int program p->pat_section = 0; /* more ? */ p->streams = 0; p->stump = splice_getstumps (programnb,-1); + clear_descrdescr (&p->manudescr); prog[progs++] = p; changed_pat = TRUE; configuration_changed = TRUE; + splice_modifycheckmatch (programnb,p,NULL,NULL); } else { outs[pid] = NULL; warn (LERR,"Open prog",ETSC,1,1,0); @@ -366,6 +390,7 @@ int splice_addstream (prog_descr *p, p->changed = TRUE; s->u.d.pid = pid; configuration_changed = TRUE; + splice_modifycheckmatch (p->program_number,p,s,NULL); } } return (pid); @@ -464,17 +489,20 @@ static int make_pmtsection (stream_descr *d++ = 0xE0 | (i >> 8); *d++ = i; d += 2; - if (s->fdescr->content == ct_program) { - i = NUMBER_DESCR; - while (--i > 0) { - byte *y; - y = s->fdescr->u.ps.stream[0]->manudescr->refx[i]; - if (y == NULL) { - y = s->fdescr->u.ps.stream[0]->autodescr->refx[i]; /* this one? why? */ - } - if (y != NULL) { - memcpy (d,y,y[1]+2); - d += y[1]+2; + i = NUMBER_DESCR; + while (--i > 0) { + byte *y; + y = p->manudescr.refx[i]; + if ((y == NULL) + && (s->u.d.mapstream != NULL)) { + y = s->u.d.mapstream->autodescr->refx[i]; /* why this one? */ + } + if (y != NULL) { + int yl = y[1]; + if (yl != 0) { + yl += 2; + memcpy (d,y,yl); + d += yl; } } } @@ -500,8 +528,12 @@ static int make_pmtsection (stream_descr y = p->stream[i]->autodescr->refx[x]; } if (y != NULL) { - memcpy (d,y,y[1]+2); - d += y[1]+2; + int yl = y[1]; + if (yl != 0) { + yl += 2; + memcpy (d,y,yl); + d += yl; + } } } x = d - e; @@ -524,8 +556,12 @@ static int make_pmtsection (stream_descr byte *y; y = st->manudescr.refx[x]; if (y != NULL) { - memcpy (d,y,y[1]+2); - d += y[1]+2; + int yl = y[1]; + if (yl != 0) { + yl += 2; + memcpy (d,y,yl); + d += yl; + } } } x = d - e;