dash: More spec-compliant handling of Location elements - #1880
Open
peaBerberian wants to merge 4 commits into
Open
dash: More spec-compliant handling of Location elements#1880peaBerberian wants to merge 4 commits into
peaBerberian wants to merge 4 commits into
Conversation
peaBerberian
force-pushed
the
better-location-handling
branch
4 times, most recently
from
August 14, 2026 16:51
58f6e56 to
4218669
Compare
While POCing supplementary DASH features, I saw that the way we handled
`<Location>` elements in the MPD, indicating where to refresh the URL,
was not proper.
Basically they said (re-formulating):
> For a manifest refresh the URL to do so should be:
> - The original MPD's URL if no `<Location>` element is present in the
MPD
> - The URL indicated by the `<Location>` elements if present
We always prepended to those the URL used to make the requests, in terms of
importance. We should not: if any `<Location>` is present, it is the new
authority to indicate where the MPD should be refreshed.
This commit fixes that.
It also does a few supplementary things:
- At the `Manifest` class level: renamed `uris` into `refreshUrls`
- `<Location>` is now properly parsed as an Element, not as if it was an
XML attribute like before
- Like for segment URLs, I now also parse the `serviceLocation`, though
I do not exploit it for now outside the parsers. This will become mainly
useful for content steering.
I looked at the spec, nothing prevent a BaseURL from not indicating any URL. It could even make sense to refer to the original URL (e.g. associated to a `serviceLocation`). This is however a edge case that both dash.js and shaka-player seems to mishandle.
peaBerberian
force-pushed
the
better-location-handling
branch
from
September 1, 2026 09:43
eef3e50 to
99f72b8
Compare
|
✅ Automated performance checks have passed on commit DetailsPerformance tests 1st run outputNo significative change in performance for tests:
|
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.
While POCing supplementary DASH features, I saw that the way we handled
<Location>elements in the MPD, indicating where to refresh the MPD, was not proper.Basically the DASH spec says (re-formulating):
We always used the original URL (used to make the request) in priority. We should not: if any
<Location>is present, those are the new preferred URLs.This commit fixes that.
It also does a few supplementary things:
At the
Manifestclass level: renamedurisintorefreshUrls, asURIwas too generic.It may now be confused with
updateUrlthough which is our concept for "an URL only useful for updates" (e.g. it can be shorter than the actual MPD, just containing the new data) where refreshUrls are all URLs to get the full version again. To see if it is too confusing - for now comments do, sadly, the work.<Location>is now properly parsed as an Element, not as if it was an XML attribute like beforeLike for
BaseURLelements, I now also parse the optionalserviceLocationattribute, though I do not exploit it for now outside the parsers. This will become mainly useful for content steering.Previously, an empty
BaseURLwas ignored. Looking closely at DASH spec, it doesn't seem that any special care should be taken for it, it should be resolved like the other ones.An empty
BaseURLmakes sense for when you want to refer to the current inherited URL (itself starting from the MPD url), probably to classify it by e.g. also adding aserviceLocationattribute - an attribute used in content steering.However for that case, I saw that both dash.js and the shaka-player mishandle it, like we did before. I nonetheless added here as the risk is close to 0 and it's more spec-compliant.
An empty or relative
<Location>had also a few edge cases: mainly it resolved to""when the MPD Url was not known (should probably be skipped here).Now it is properly skipped with a warning