From 1cde8964c1bd71807b446d715479f62502b9a1ca Mon Sep 17 00:00:00 2001 From: Andy Date: Mon, 2 Feb 2026 12:02:16 -0700 Subject: [PATCH] fix(dash): preserve MPD DRM instead of overwriting from init segment The init_data DRM extraction was unconditionally overwriting DRM already extracted from MPD ContentProtection elements. This caused failures when init segments contain malformed PSSH data while the MPD has valid PSSH. Now only falls back to init_data extraction when no DRM was found from the manifest, matching the behavior in version 2.1.0. --- unshackle/core/manifests/dash.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unshackle/core/manifests/dash.py b/unshackle/core/manifests/dash.py index caebcc9..c8a7ef7 100644 --- a/unshackle/core/manifests/dash.py +++ b/unshackle/core/manifests/dash.py @@ -476,7 +476,7 @@ class DASH: track.data["dash"]["timescale"] = int(segment_timescale) track.data["dash"]["segment_durations"] = segment_durations - if init_data and isinstance(track, (Video, Audio)): + if not track.drm and init_data and isinstance(track, (Video, Audio)): prefers_playready = isinstance(cdm, PlayReadyCdm) or (hasattr(cdm, "is_playready") and cdm.is_playready) if prefers_playready: try: