Skip to content

enableManifestDurationMismatchFix does not work for periods without duration field #4736

@KimmyWFox

Description

@KimmyWFox
Environment
  • Dash.js version: v4.7.4 (haven't try with v5, but read the code. Issue should still exists)
  • Browser name/version: Chrome
  • OS name/version: Mac
Steps to reproduce

Set enableManifestDurationMismatchFix to true and play an asset with duration mismatch issue and some periods in the MPD does not have duration field.

Observed behavior

The duration is still the incorrect value from MediaPresentationDuration instead of the sum of all periods.

Root cause

https://github.com/Dash-Industry-Forum/dash.js/blob/development/src/streaming/ManifestLoader.js#L218
When calculating sum of all periods, currently, we are
const sumPeriodDurations = manifest.Period.reduce((totalDuration, period) => totalDuration + period.duration, 0);
Therefore, if there are any periods without duration, sumPeriodDuration will be NaN, and it will not continue to do the duration fix.

Potential fix

Use the SegmentTemplate to calculate the real duration.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions