From 72a5de337357fa9808509efc0e63a6b1ba4f4077 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Velad=20Galv=C3=A1n?= Date: Wed, 25 Oct 2023 18:24:41 +0200 Subject: [PATCH] fix: Fix DRM workaround for Tizen and Xbox with ac-4 boxes (#5812) `content_workarounds.js` was introduced for Tizen and Xbox platforms. We found that that meant a regression where certain streams were unable to be played. This PR adds ac-4 into the content workarounds in the same was as ec-4 to ensure these streams can be played once more. --- lib/media/content_workarounds.js | 6 ++++++ test/media/content_workarounds_unit.js | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/media/content_workarounds.js b/lib/media/content_workarounds.js index a06a998a8c..3976a77f33 100644 --- a/lib/media/content_workarounds.js +++ b/lib/media/content_workarounds.js @@ -105,6 +105,12 @@ shaka.media.ContentWorkarounds = class { newType: ContentWorkarounds.BOX_TYPE_ENCA_, }); }) + .fullBox('ac-4', (box) => { + boxesToModify.push({ + box, + newType: ContentWorkarounds.BOX_TYPE_ENCA_, + }); + }) .fullBox('mp4a', (box) => { boxesToModify.push({ box, diff --git a/test/media/content_workarounds_unit.js b/test/media/content_workarounds_unit.js index 70efb9848e..261f54ff10 100644 --- a/test/media/content_workarounds_unit.js +++ b/test/media/content_workarounds_unit.js @@ -7,7 +7,7 @@ describe('ContentWorkarounds', () => { const encryptionBoxes = { 'encv': ['hev1', 'hvc1', 'avc1', 'avc3'], - 'enca': ['ac-3', 'ec-3', 'mp4a'], + 'enca': ['ac-3', 'ec-3', 'ac-4', 'mp4a'], }; for (const encryptionBox of Object.keys(encryptionBoxes)) { for (const box of encryptionBoxes[encryptionBox]) {