--- multiplexer/showts.c 2003/10/22 21:54:06 1.4 +++ multiplexer/showts.c 2004/01/27 19:46:07 1.5 @@ -40,6 +40,8 @@ static struct option long_options[] = { {"help" , 0, NULL, 'h'}, {"summary", 0, NULL, 's'}, {"analyse", 0, NULL, 'a'}, + {"pcr" , 0, NULL, 'P'}, + {"start", 0, NULL, 'S'}, {NULL, 0, NULL, 0} }; @@ -50,6 +52,10 @@ static int show_summary = 0; static int show_packets = 1; static int show_pids = 1; +static int show_cc_jumps = 1; +static int show_pcr = 0; +static int show_start = 0; + static int pid_cnt = 0; static int packet_cnt = 0; static int broken_sync_cnt = 0; @@ -62,6 +68,8 @@ static void usage () " -h, --help show usage\n" " -s, --summary show summary\n" " -a, --analyse analyse stream statistics\n" + " -P, --pcr indicate PCR\n" + " -S, --start indicate unit start\n" , program); } @@ -88,7 +96,7 @@ int main (int argc, char **argv) int opt; // char *endptr; - opt = getopt_long (argc, argv, "+hsa", long_options, &option_index); + opt = getopt_long (argc, argv, "+hsPSa", long_options, &option_index); if (opt == -1) break; switch (opt) { @@ -102,6 +110,18 @@ int main (int argc, char **argv) show_packets = 0; break; + case 'S': + show_cc_jumps = 0; + show_start = 1; + show_pcr = 0; + break; + + case 'P': + show_cc_jumps = 0; + show_start = 0; + show_pcr = 1; + break; + case 'h': usage (); exit (0); @@ -293,6 +313,7 @@ int main (int argc, char **argv) char outbuf[1]; int pidtype; + int togglec; sync = buffer[0]; error_ind = (buffer[1] & 0x80) >> 7; @@ -429,12 +450,21 @@ int main (int argc, char **argv) goto char_written; } + if (show_cc_jumps) + togglec = !ccok; + else if (show_pcr) + togglec = pcr; + else if (show_start) + togglec = unit_start; + else + togglec = 0; + if (pid == 0) - outbuf[0] = ccok ? '=' : '#'; + outbuf[0] = togglec ? '#' : '='; else if (pid == 0x1fff) - outbuf[0] = ccok ? '\'' : '"'; + outbuf[0] = togglec ? '"' : '\''; else - outbuf[0] = 0x40 + pidtype + (ccok ? 0x20 : 0); + outbuf[0] = 0x40 + pidtype + (togglec ? 0 : 0x20); ccs[pid] = (cc + 1) & 0x0F;