PSSH: Dump the same version as the loaded data

Currently, even though self.version would be 0, it would dump as a version=1 box with key_IDs set to data (where possible).

This is because pymp4 sets the version to 1 if key_IDs is set with data, as that would make it a v1 PSSH box. So effectively .dump() and .dumps() forces a v1 box as output even if you loaded or created a v0 box.

Fixes #16
This commit is contained in:
rlaphoenix 2022-10-13 11:21:00 +01:00
parent eaa26399e0
commit 7c91f2c59a
1 changed files with 1 additions and 1 deletions

View File

@ -235,7 +235,7 @@ class PSSH:
version=self.version, version=self.version,
flags=self.flags, flags=self.flags,
system_ID=self.system_id, system_ID=self.system_id,
key_IDs=self.key_ids, key_IDs=self.key_ids if self.version == 1 and self.key_ids else None,
init_data=self.init_data init_data=self.init_data
)) ))