From 1916749e9f68507498dde6d3192e1e29527861cf Mon Sep 17 00:00:00 2001 From: Alvaro Velad Galvan Date: Thu, 19 Jan 2023 19:05:21 +0100 Subject: [PATCH] fix(DASH): Fix dynamic manifests from edgeware --- lib/dash/segment_template.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/dash/segment_template.js b/lib/dash/segment_template.js index 8709dda1c7..65a080059b 100644 --- a/lib/dash/segment_template.js +++ b/lib/dash/segment_template.js @@ -101,12 +101,14 @@ shaka.dash.SegmentTemplate = class { const periodStart = context.periodInfo.start; const periodEnd = context.periodInfo.duration ? context.periodInfo.start + context.periodInfo.duration : Infinity; + const isLastPeriod = context.periodInfo.isLastPeriod; // Don't fit live content, since it might receive more segments. // Unless that live content is multi-period; it's safe to fit every period // but the last one, since only the last period might receive new // segments. - const shouldFit = periodEnd != Infinity; + const shouldFit = + periodEnd != Infinity && (!isLastPeriod || !context.dynamic); if (segmentIndex) { if (shouldFit) {