--- multiplexer/global.h 2001/07/20 16:49:55 1.13 +++ multiplexer/global.h 2001/08/01 08:23:18 1.14 @@ -190,9 +190,9 @@ typedef struct { /* Release a chained list completely */ #define releasechain(typ,root) \ - { register typ *n, *p = root; \ - while (p != NULL) { \ - n = p->next; free (p); p = n; \ + { register typ *relchn_n, *relchn_p = root; \ + while (relchn_p != NULL) { \ + relchn_n = relchn_p->next; free (relchn_p); relchn_p = relchn_n; \ } } /* Supported input file types */ @@ -310,6 +310,24 @@ typedef struct { } u; } file_descr; +/* Descriptors, data and reference index list */ +typedef struct { + byte *refx[NUMBER_ELEMD]; + byte data[MAX_PSI_SIZE]; +} descr_descr; + +/* Stream entry in target PMT, without corresponding input stream. + * This is used to manually denote si streams, that are brought in + * via --si and have to be mentioned in PMT in some way. + */ +typedef struct stumpdescr { + struct stumpdescr *next; + int program_number; + short pid; + byte stream_type; + descr_descr manudescr; +} stump_descr; + /* Target program */ typedef struct { int program_number; @@ -321,6 +339,7 @@ typedef struct { short pat_section; short streams; struct streamdescr *stream[MAX_STRPERPRG]; + stump_descr *stump; /* just entries in PMT, not really data streams */ } prog_descr; /* Single data or map stream */ @@ -330,27 +349,27 @@ typedef struct streamdescr { file_descr *fdescr; short sourceid; /* index into fdescr->u.xx.stream[] */ byte stream_id; /* elementary stream id, table 2-35, etc */ - byte stream_type; + byte stream_type; /* table 2-29 */ byte version; byte conticnt; byte endaction; - byte *elemdvld[NUMBER_ELEMD]; /* as valid for out */ - byte elemdescr[MAX_PSI_SIZE]; + descr_descr *autodescr; /* Descriptors copied from input stream */ + descr_descr *manudescr; /* Descriptors manually added */ /*what if a stream is leftupper corner in one prog, but elsewhere in another?*/ streamdata_type streamdata; union { struct { - struct streamdescr *mapstream; - t_msec next_clockref; - t_msec delta; - conversion_base conv; - t_msec lasttime; short pid; /* splicets: 0010..1FFE, spliceps: ...FF */ boolean discontinuity; boolean trigger; boolean mention; boolean has_clockref; /* in output */ boolean has_opcr; /* in input */ + struct streamdescr *mapstream; + t_msec next_clockref; + t_msec delta; + conversion_base conv; + t_msec lasttime; short progs; prog_descr *pdescr[MAX_PRGFORSTR]; } d;