pid-count.py: improve sync
This commit is contained in:
parent
e4cdd3ca0f
commit
3e4c8e7314
1 changed files with 5 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue