]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
tsdemux: hack for PCR extraction now PMT monitoring is disabled
authorAdam Sutton <dev@adamsutton.me.uk>
Tue, 22 Apr 2014 13:04:17 +0000 (14:04 +0100)
committerAdam Sutton <dev@adamsutton.me.uk>
Tue, 22 Apr 2014 13:04:17 +0000 (14:04 +0100)
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

index 42434d3a1ed4e775cfe08ff21b9748bfff3ebd43..5010e45604c9c52f14bc358a87cc26e0cd00c29c 100644 (file)
@@ -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;