Skip to content

Commit 488ad38

Browse files
committed
いちいちビット演算をしない
1 parent 7944920 commit 488ad38

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

ariblib/command/split.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import itertools
2+
import struct
23

34
from ariblib import packet, tsopen
45
from ariblib.sections import ProgramAssociationSection, ProgramMapSection
@@ -26,10 +27,7 @@ def replace_pat(pat):
2627
new_pat = bytearray(pat[:16])
2728
new_pat[2] = 0x11
2829
crc = crc32(new_pat)
29-
new_pat.append((crc >> 24) & 0xFF)
30-
new_pat.append((crc >> 16) & 0xFF)
31-
new_pat.append((crc >> 8) & 0xFF)
32-
new_pat.append(crc & 0xFF)
30+
new_pat.extend(struct.pack('>L', crc))
3331
new_pat.extend([0xFF] * 163)
3432
return new_pat
3533

0 commit comments

Comments
 (0)