From d20a8709e9a5647b62723de4f830e65e9d45350e Mon Sep 17 00:00:00 2001 From: has992 <89402453+has992@users.noreply.github.com> Date: Tue, 12 Nov 2024 08:43:28 +0000 Subject: [PATCH] fix(DASH): Exclude text segments when calculating max segment size (#7564) This PR excludes the use of text segments when calculating the max segment size. This is due to Shaka using the max value between the buffer behind and max segment size. The max segment size of text segments can be a lot larger than video segments. This can cause the buffer behind to be extremely large and is a particular problem for low powered devices, which have memory constraints. --------- Co-authored-by: Joey Parrish --- AUTHORS | 1 + CONTRIBUTORS | 1 + lib/dash/segment_template.js | 8 ++++++-- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/AUTHORS b/AUTHORS index c68b50c292..39cf13edea 100644 --- a/AUTHORS +++ b/AUTHORS @@ -45,6 +45,7 @@ Gil Gonen Giorgio Gamberoni Giuseppe Samela Google Inc. <*@google.com> +Hassan Bashir Ivan Kohut Itay Kinnrot Jaeseok Lee diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 6a875a83c5..76351d75e1 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -63,6 +63,7 @@ Gerardo Meola Gil Gonen Giorgio Gamberoni Giuseppe Samela +Hassan Bashir Hichem Taoufik Ivan Kohut Itay Kinnrot diff --git a/lib/dash/segment_template.js b/lib/dash/segment_template.js index 627937dffb..f1cd9fde82 100644 --- a/lib/dash/segment_template.js +++ b/lib/dash/segment_template.js @@ -85,7 +85,9 @@ shaka.dash.SegmentTemplate = class { }, }; } else if (info.segmentDuration) { - if (!isUpdate && context.adaptationSet.contentType !== 'image') { + if (!isUpdate && + context.adaptationSet.contentType !== 'image' && + context.adaptationSet.contentType !== 'text') { const periodStart = context.periodInfo.start; const periodId = context.period.id; const initialPeriodDuration = context.periodInfo.duration; @@ -172,7 +174,9 @@ shaka.dash.SegmentTemplate = class { tsi.evict(availabilityStart); } - if (info.timeline && context.adaptationSet.contentType !== 'image') { + if (info.timeline && + context.adaptationSet.contentType !== 'image' && + context.adaptationSet.contentType !== 'text') { const timeline = info.timeline; context.presentationTimeline.notifyTimeRange( timeline,