fix(drm): decrypt a track with mp4decrypt when its sample offsets are not relative to the moof

This commit is contained in:
imSp4rky
2026-12-04 14:53:46 -07:00
parent bec5354293
commit 491764d991
3 changed files with 126 additions and 5 deletions
+5
View File
@@ -195,6 +195,11 @@ unshackle decrypts a stereoscopic 3D (MV-HEVC) track with mp4decrypt whatever th
shaka-packager refuses its Dolby Vision configuration (version 3), and before v3.5.0 it also drops
the boxes of the second view.
unshackle also uses mp4decrypt, whatever this setting says, for a fragmented track whose first
`moof` gives a base data offset in its `tfhd` or has a `trun` with no data offset, as
`MP4Box -frag` writes. shaka-packager reads every sample offset from the start of the `moof`, so
it writes noise for such a track.
mp4decrypt finds a content key by the KID in the first `sinf` box of the track. When that box
has no CENC `tenc` (for example, a PIFF `sinf` before the CENC one), unshackle also gives
mp4decrypt the content key of that KID by track ID. When mp4decrypt copies a track through