v0.27.0: detect AACS-scrambled units by raw TS sync, not flag bits

Rename is_unit_encrypted -> is_aacs_scrambled and decide encryption from the unit's MPEG-TS sync bytes (destroyed by the encrypted body) instead of the TP_extra copy-control (byte 0) or TS scrambling-control (byte 7) flags, which discs do not set reliably. One shared predicate now backs the decrypt gate and out-of-band key validation, so callers agree on what 'encrypted' means. Decryption restores the syncs, so a decrypted unit reads as clear and there is no flag to clear.
This commit is contained in:
MattJackson
2026-06-03 07:35:50 -07:00
parent c8eb42b490
commit b518860d9c
8 changed files with 138 additions and 132 deletions
+1 -1
View File
@@ -1292,7 +1292,7 @@ mod tests {
let original = std::fs::read(unit_path).unwrap();
assert_eq!(original.len(), ALIGNED_UNIT_LEN);
assert!(
super::super::decrypt::is_unit_encrypted(&original),
super::super::decrypt::is_aacs_scrambled(&original),
"Unit should be encrypted"
);