Probably should just force PMT monitoring on for tsfile input and
only extract PCR from "known" good PID. However I've found in
practice the "real" PCR streams are typically video streams that
also include payload. So this hack works for now.
#endif
/* Extract PCR (do this early for tsfile) */
- if(tsb[3] & 0x20 && tsb[4] > 0 && tsb[5] & 0x10 && !error) {
+ if(((tsb[3] & 0x30) == 0x30) && (tsb[4] > 5) && (tsb[5] & 0x10) && !error) {
pcr = (uint64_t)tsb[6] << 25;
pcr |= (uint64_t)tsb[7] << 17;
pcr |= (uint64_t)tsb[8] << 9;