--- multiplexer/splicets.c 2004/10/28 21:08:18 1.23 +++ multiplexer/splicets.c 2005/01/15 20:39:50 1.24 @@ -1,7 +1,7 @@ /* * ISO 13818 stream multiplexer * Copyright (C) 2001 Convergence Integrated Media GmbH Berlin - * Copyright (C) 2004 Oskar Schirmer (schirmer@scara.com) + * Copyright (C) 2004..2005 Oskar Schirmer (schirmer@scara.com) * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -60,6 +60,7 @@ static byte psi_data [MAX_PSI_SIZE]; static byte unit_start; static byte *conticnt; static int psi_pid; +static short network_pid = 0; static int progs; static prog_descr *prog [MAX_OUTPROG]; @@ -96,6 +97,15 @@ void splice_setpsifrequency (t_msec freq psi_frequency_changed = TRUE; } +void splice_setnetworkpid (short pid) +{ + if ((pid < 0) || (pid > TS_PID_HIGHEST)) { + network_pid = 0; + } else { + network_pid = pid; + } +} + static int findapid (stream_descr *s, int desire) { byte okness = 2; @@ -473,6 +483,12 @@ static int make_patsection (int section, *d++ = x; } } + if (network_pid > 0) { + *d++ = 0; + *d++ = 0; + *d++ = 0xE0 | (network_pid >> 8); + *d++ = network_pid; + } i = d + CRC_SIZE - dest - TS_TRANSPORTID; dest[TS_SECTIONLEN] = 0xB0 | (i >> 8); dest[TS_SECTIONLEN+1] = i;