From 7c91f2c59a703e3a8d6f053f71d3ab18a779edb1 Mon Sep 17 00:00:00 2001 From: rlaphoenix Date: Thu, 13 Oct 2022 11:21:00 +0100 Subject: [PATCH] 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 --- pywidevine/pssh.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pywidevine/pssh.py b/pywidevine/pssh.py index 73d7383..147e1d3 100644 --- a/pywidevine/pssh.py +++ b/pywidevine/pssh.py @@ -235,7 +235,7 @@ class PSSH: version=self.version, flags=self.flags, 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 ))