]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
pid-count.py: improve sync
authorJaroslav Kysela <perex@perex.cz>
Mon, 30 Mar 2015 15:03:56 +0000 (17:03 +0200)
committerJaroslav Kysela <perex@perex.cz>
Mon, 30 Mar 2015 15:03:56 +0000 (17:03 +0200)
support/pid-count.py

index 3c1d79ad9e9246edde25b5d3f75b52ad90fd6620..8e864bf5372044e098b1f5bc70292188dd47f1ec 100755 (executable)
@@ -14,6 +14,9 @@ pids_cc_err = {}
 fp = open(sys.argv[1])
 while True:
   tsb = fp.read(188)
+  while tsb and tsb[0] != '\x47':
+    tsb = tsb[1:] + fp.read(1)
+    print 'skip1'
   if len(tsb) < 16:
     break
   tsb = map(ord, tsb[:16])
@@ -26,6 +29,8 @@ while True:
     pids[pid] = 1
   else:
     pids[pid] += 1
+  if pid == 0x1fff:
+    continue
   cc = tsb[3]
   if cc & 0x10:
     cc &= 0x0f