Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(DASH): Fix dynamic manifests from edgeware #4914

Merged
merged 4 commits into from
Jan 30, 2023
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 17 additions & 5 deletions lib/dash/segment_template.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,23 @@ shaka.dash.SegmentTemplate = class {
const periodEnd = context.periodInfo.duration ?
context.periodInfo.start + context.periodInfo.duration : Infinity;

// 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;
/* When to fit segments. All refactors should honor/update this table:
*
* | dynamic | infinite | last | should | notes |
* | | period | period | fit | |
* | ------- | -------- | ------ | ------ | ------------------------- |
* | F | F | X | T | typical VOD |
* | F | T | X | X | impossible: infinite VOD |
* | T | F | F | T | typical live, old period |
* | T | F | T | F | typical IPR |
* | T | T | F | X | impossible: old, infinite |
* | T | T | T | F | typical live, new period |
*/

// We never fit the final period of dynamic content, which could be
// infinite live (with no limit to fit to) or IPR (which would expand the
// most recent segment to the end of the presentation).
const shouldFit = !(context.dynamic && context.periodInfo.isLastPeriod);

if (segmentIndex) {
if (shouldFit) {
Expand Down