From 42c54418be293527a80ef85836eb5503441b434e Mon Sep 17 00:00:00 2001 From: Adam Sutton Date: Tue, 22 Apr 2014 14:04:17 +0100 Subject: [PATCH] tsdemux: hack for PCR extraction now PMT monitoring is disabled 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. --- src/input/mpegts/tsdemux.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/input/mpegts/tsdemux.c b/src/input/mpegts/tsdemux.c index 42434d3a..5010e456 100644 --- a/src/input/mpegts/tsdemux.c +++ b/src/input/mpegts/tsdemux.c @@ -189,7 +189,7 @@ ts_recv_packet1 #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;