From 23dd8c92129c16f035ffa19bf79a77263375197c Mon Sep 17 00:00:00 2001 From: Evan Burton <2407836+iamboorrito@users.noreply.github.com> Date: Wed, 10 Apr 2024 15:11:31 -0700 Subject: [PATCH] Bugfix: Patch for light player exception with audio groups (#6342) * Don't look through audio groups if environment __USE_ALT_AUDIO__ is false * Update entries 10 -> 13 to add tests to light build --- src/utils/rendition-helper.ts | 5 ++++- tests/functional/auto/setup.js | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/utils/rendition-helper.ts b/src/utils/rendition-helper.ts index 1e733489bb6..63dee30a3de 100644 --- a/src/utils/rendition-helper.ts +++ b/src/utils/rendition-helper.ts @@ -269,12 +269,15 @@ export function getCodecTiers( tier.fragmentError += level.fragmentError; tier.videoRanges[level.videoRange] = (tier.videoRanges[level.videoRange] || 0) + 1; - if (audioGroups) { + if (__USE_ALT_AUDIO__ && audioGroups) { audioGroups.forEach((audioGroupId) => { if (!audioGroupId) { return; } const audioGroup = audioTracksByGroup.groups[audioGroupId]; + if (!audioGroup) { + return; + } // Default audio is any group with DEFAULT=YES, or if missing then any group with AUTOSELECT=YES, or all variants tier.hasDefaultAudio = tier.hasDefaultAudio || audioTracksByGroup.hasDefaultAudio diff --git a/tests/functional/auto/setup.js b/tests/functional/auto/setup.js index 44b76df8f36..45b44167e42 100644 --- a/tests/functional/auto/setup.js +++ b/tests/functional/auto/setup.js @@ -613,7 +613,7 @@ describe(`testing hls.js playback in the browser on "${browserDescription}"`, fu const entries = Object.entries(streams); if (HlsjsLightBuild) { - entries.length = 10; + entries.length = 13; } entries