Repository navigation
Conversation
A static multi-Period MPD that only gives Period@start filled every Period to the full mediaPresentationDuration, so segments ran past the Period end. Per ISO/IEC 23009-1 5.3.2.1 a Period without @duration ends where the next Period starts, and the last one ends at mediaPresentationDuration. Fixes videojs#195
Author
|
Friendly ping when you have time. Is there anything you'd like changed here? |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #195
Problem
toAdaptationSetssetperiodDurationonly from an explicitPeriod@duration. When a static multi-Period MPD gives onlyPeriod@start,parseByDurationfell back tosourceDuration(the fullmediaPresentationDuration) for every Period. So each Period got segments for the whole presentation, running past its own end. For the MPD in the issue, Period 2 gotb-1..b-4at10, 15, 20, 25instead ofb-1, b-2at10, 15.Fix
New
getPeriodDurationhelper, next togetPeriodStart, following ISO/IEC 23009-1 5.3.2.1:Period@durationif present (same as before).mediaPresentationDurationminus its start.A last Period that starts at 0 still gets no
periodDuration, so it keeps usingsourceDurationlike before (single-Period MPDs don't change). If the end is unknown, or not after the start, nothing is set, which is also the old behavior.periodDurationis only read on the static@durationpath, so dynamic MPDs andSegmentTimelinedon't change. The<S r="-1">path still usessourceDuration; that is #196 and I left it out of this PR.Tests
getPeriodDuration: explicit duration, next start (static and dynamic), last static Period, and the cases that returnundefined.parse()test with the MPD from the issue. It fails onmain.inheritAttributes > end to end - basic multiperiodnow expectsperiodDuration: 30on the second Period (mediaPresentationDuration60, start 30). It had noperiodDurationbefore.npm run build-test && npm run test:node: 201 pass.npm run lint: same 11 existing warnings asmain, 0 errors. I did not run the karma browser suite locally.dist/mpd-parser.cjs.jsnow printsa a-1.m4s@0 a-2.m4s@5andb b-1.m4s@10 b-2.m4s@15.Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.