Skip to content

Commit

Permalink
fix(DASH): Exclude text segments when calculating max segment size (#…
Browse files Browse the repository at this point in the history
…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 <[email protected]>
  • Loading branch information
2 people authored and avelad committed Nov 12, 2024
1 parent 8b0c1eb commit d20a870
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ Gil Gonen <[email protected]>
Giorgio Gamberoni <[email protected]>
Giuseppe Samela <[email protected]>
Google Inc. <*@google.com>
Hassan Bashir <[email protected]>
Ivan Kohut <[email protected]>
Itay Kinnrot <[email protected]>
Jaeseok Lee <[email protected]>
Expand Down
1 change: 1 addition & 0 deletions CONTRIBUTORS
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ Gerardo Meola <[email protected]>
Gil Gonen <[email protected]>
Giorgio Gamberoni <[email protected]>
Giuseppe Samela <[email protected]>
Hassan Bashir <[email protected]>
Hichem Taoufik <[email protected]>
Ivan Kohut <[email protected]>
Itay Kinnrot <[email protected]>
Expand Down
8 changes: 6 additions & 2 deletions lib/dash/segment_template.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit d20a870

Please sign in to comment.