-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Open
Labels
Description
Environment
- The MPD passes the DASH-IF Conformance Tool on https://conformance.dashif.org/
- The stream has correct Access-Control-Allow-Origin headers (CORS)
- There are no network errors such as 404s in the browser console when trying to play the stream
- The issue observed is not mentioned on https://github.com/Dash-Industry-Forum/dash.js/wiki/FAQ
- The issue occurs in the latest reference client on http://reference.dashif.org/dash.js/ and not just on my page
- 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.