Use tenc boxes within uuid boxes as another fallback for get_key_id

This commit is contained in:
rlaphoenix 2023-03-28 20:25:30 +01:00
parent 5b7fadbc55
commit b301fb4390
1 changed files with 7 additions and 0 deletions

View File

@ -124,6 +124,13 @@ class Track:
if tenc.key_ID.int != 0: if tenc.key_ID.int != 0:
return tenc.key_ID return tenc.key_ID
# look for UUID mp4 boxes holding track encryption mp4 boxes
for uuid_box in get_boxes(init_data, b"uuid"):
if uuid_box.extended_type == UUID("8974dbce-7be7-4c51-84f9-7148f9882554"):
tenc = uuid_box.data
if tenc.key_ID.int != 0:
return tenc.key_ID
def get_init_segment( def get_init_segment(
self, self,
maximum_size: int = 20000, maximum_size: int = 20000,