Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
pid-count.py: improve sync
  • Loading branch information
perexg committed Mar 30, 2015
1 parent e4cdd3c commit 3e4c8e7
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions support/pid-count.py
Expand Up @@ -14,6 +14,9 @@
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])
Expand All @@ -26,6 +29,8 @@
pids[pid] = 1
else:
pids[pid] += 1
if pid == 0x1fff:
continue
cc = tsb[3]
if cc & 0x10:
cc &= 0x0f
Expand Down

0 comments on commit 3e4c8e7

Please sign in to comment.