shaka-project / shaka-packager

A media packaging and development framework for VOD and Live DASH and HLS applications, supporting Common Encryption for Widevine and other DRM Systems.
https://shaka-project.github.io/shaka-packager/
Other
1.9k stars 496 forks source link

fix: escape media URLs in MPD #1395

Closed cosmin closed 1 month ago

cosmin commented 1 month ago

Currently media_info.media_file_url() is not escaped when placed into MPD for things like BaseURL. This for example breaks when trying to us a file name that contains special characters like &. Since these are supposed to be URLs let's URL encode them.

Fixes #1107

unext-wendong commented 1 week ago

Was it intentional to use URL encode instead of XML encode?

Actually for XML/HTML, only the following 5 characters need to be escaped

> < & ' "

URL encoding does much more than this. Characters like forward slashes are also encoded.