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

BaseURL failover not working with relative network-path URLs (?) #9856

Closed
jarhoax opened this issue Jan 12, 2022 · 3 comments
Closed

BaseURL failover not working with relative network-path URLs (?) #9856

jarhoax opened this issue Jan 12, 2022 · 3 comments
Assignees
Labels

Comments

@jarhoax
Copy link

jarhoax commented Jan 12, 2022

Hi folks,

I've recently checked on baseURL failover for DASH manifests that was added with ExoPlayer version 2.15.0 and found an asset not working as expected.

I cannot share the content url however it should be easily reproducible with the following snippet:

<Period>
    <BaseURL>//anotherhost.com/some/url/1</BaseURL>
    <BaseURL>//anotherhost.com/some/url/2</BaseURL>
    ...
</Period>

I'm not sure if those relative network-path are considered to be valid and/or supported, so thought I'll bring this to your attention.

From what I can tell from my observation is, that in such a case the serviceLocation is mapped to the manifests base Url, and down the line being added to the exclusion list (after the first BaseUrl failed), thus excluding all base urls with the same serviceLocation.

Happy to hear your thoughts.

@ojw28
Copy link
Contributor

ojw28 commented Jan 12, 2022

@marcbaechinger - I seem to remember that we implemented BaseURL exclusion according to the DASH DVB spec, which also groups BaseURL elements by dvb:priority. In the current implementation, do all BaseURL elements get excluded together unless they specify different dvb:priority values? If so then:

  1. I wonder if that's what's happening here, because BaseURL elements that don't specify dvb:priority presumably all get assigned the same default priority value.
  2. I think this would probably be incorrect behavior unless the DASH manifest specifies that it's authored according to a urn:dvb:dash:profile:dvb-dash profile and/or includes explicit dvb:priority attributes. If it does neither, the author of the manifest would not expect the fallback behavior to be as defined in the DASH DVB spec, and we should probably only group by service location.

Note: My theory is different to the author's theory above. Either could be true!

@ojw28 ojw28 assigned marcbaechinger and unassigned ojw28 Jan 12, 2022
@marcbaechinger
Copy link
Contributor

marcbaechinger commented Jan 12, 2022

I think both theories are correct and both are a result of the implementation following the DVB spec (ETSI TS 103 285 V1.2.1 (2018-03)) - 10.8.2.1. The DASH spec itself does not define a specific handling what to use or how to exclude: The DASH Client may use base URLs provided in the BaseURL element as “base URI” and may implement any suitable algorithm to determine which URLs it uses for requests.. Excluding both if one of it fails does still not look right in the sense of the DASH spec I'd say.

Our implementation following the DVB spec, makes a relative baseURL inherit all properties from the parent baseURL. So any attribute declared on a relative baseURL is ignored.

For a manifest with the snippet above both of these attributes above would inherit the values and have the same serviceLocation and priority and weight and hence if one of it is selected and then fails, the other would be excluded as well (either because of identical serviceLocation or priority).

It's also true that the current implementation does this even if no dvb namespace is declared in the manifest.

Possible workaround with the current implementation
@jarhoax If you want to make this work with the current implementation you would have to make one or both of these baseURLs absolute by adding a scheme (like https). This would result in the parser using the baseURL itself as the serviceLocation. You would then also need to declare a dvb:priority to the absolute baseURL that is different then the priority of the parent baseURL that is 1.

Proposed change of implementation
I think we should change the implementation in a way that we discriminate between manifests that have the dvb namespace declared and such that don't. Former is the current implementation, but latter should probably not inherit values from the parent base URL. We then should also either assign different priorities to baseURLs (the DASH spec allows the client to implement any suitable algorithm) or ignore priorities completely when excluding base URLs.

Not sure whether this is a bug or an enhancement. :) Marking as a bug as the author of the above manifest does not expect that both base URls are excluded.

@jarhoax
Copy link
Author

jarhoax commented Jan 12, 2022

Thanks for the details!

If you want to make this work with the current implementation you would have to make one or both of these baseURLs absolute by adding a scheme (like https). This would result in the parser using the baseURL itself as the serviceLocation. You would then also need to declare a dvb:priority to the absolute baseURL that is different then the priority of the parent baseURL that is 1.

Thanks! I played around while investigating and ended up applying exactly what you just suggested as a workaround to make this particular stream working. Nonetheless I wanted to let you know that the original manifest wasn't working as expected. :) And reading your proposed change seems like my assumption was correct.

tonihei pushed a commit that referenced this issue Jan 17, 2022
@tonihei tonihei closed this as completed Jan 17, 2022
icbaker pushed a commit to androidx/media that referenced this issue Jan 26, 2022
@google google locked and limited conversation to collaborators Mar 19, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants