Removed magic number from DPP supplemental metadata

Makes all the tests work but it's weird it's not being
found
This commit is contained in:
Jamie Hardt
2023-06-10 00:48:49 -07:00
parent 156568488e
commit 0c418cecdd

View File

@@ -548,9 +548,9 @@ class DolbyAtmosSupplementalMetadata:
h = BytesIO(data) h = BytesIO(data)
magic = unpack("<I", h.read(4)) magic = unpack("<I", h.read(4))
assert magic == cls.MAGIC, "Magic value was not found" # assert magic == cls.MAGIC, "Magic value was not found"
object_count = unpack("<H", h.read(2)) object_count = unpack("<H", h.read(2))[0]
h.read(1) #skip 1 h.read(1) #skip 1
@@ -563,7 +563,7 @@ class DolbyAtmosSupplementalMetadata:
h.read(object_count) # skip object_count bytes h.read(object_count) # skip object_count bytes
for _ in range(object_count): for _ in range(object_count):
binaural_mode = unpack("B", h.read(1)) binaural_mode = unpack("B", h.read(1))[0]
binaural_mode &= 0x7 binaural_mode &= 0x7
render_modes.append(binaural_mode) render_modes.append(binaural_mode)
@@ -582,7 +582,7 @@ class WavDolbyMetadataReader:
#: indicating if the segment's checksum was valid, and the #: indicating if the segment's checksum was valid, and the
#: segment's parsed dataclass (or a `bytes` array if it was #: segment's parsed dataclass (or a `bytes` array if it was
#: not recognized). #: not recognized).
segment_list: Tuple[Union[SegmentType, int], bool, Any] segment_list: List[Tuple[Union[SegmentType, int], bool, Any]]
version: Tuple[int,int,int,int] version: Tuple[int,int,int,int]
@@ -625,8 +625,8 @@ class WavDolbyMetadataReader:
segment = DolbyDigitalPlusMetadata.load(segment) segment = DolbyDigitalPlusMetadata.load(segment)
elif stype == SegmentType.DolbyAtmos: elif stype == SegmentType.DolbyAtmos:
segment = DolbyAtmosMetadata.load(segment) segment = DolbyAtmosMetadata.load(segment)
# elif stype == SegmentType.DolbyAtmosSupplemental: elif stype == SegmentType.DolbyAtmosSupplemental:
# segment = DolbyAtmosSupplementalMetadata.load(segment) segment = DolbyAtmosSupplementalMetadata.load(segment)
self.segment_list.append( (stype, checksum == expected_checksum, segment) ) self.segment_list.append( (stype, checksum == expected_checksum, segment) )
@@ -644,12 +644,12 @@ class WavDolbyMetadataReader:
return [x[2] for x in self.segment_list \ return [x[2] for x in self.segment_list \
if x[0] == SegmentType.DolbyAtmos and x[1]] if x[0] == SegmentType.DolbyAtmos and x[1]]
# def dolby_atmos_supplemental(self) -> List[DolbyAtmosSupplementalMetadata]: def dolby_atmos_supplemental(self) -> List[DolbyAtmosSupplementalMetadata]:
# """ """
# Every valid Dolby Atmos Supplemental metadata segment in the file. Every valid Dolby Atmos Supplemental metadata segment in the file.
# """ """
# return [x[2] for x in self.segment_list \ return [x[2] for x in self.segment_list \
# if x[0] == SegmentType.DolbyAtmosSupplemental and x[1]] if x[0] == SegmentType.DolbyAtmosSupplemental and x[1]]
def to_dict(self) -> dict: def to_dict(self) -> dict: