GNOME Bugzilla – Bug 725137
hlsdemux: fails to compute media playlist URL if there is a query parameter
Last modified: 2014-02-28 08:38:14 UTC
If the URL for the master manifest files contains a '/' character in the query parameter (for example http://example.net/1054559_h264_1500k.mp4/master.m3u8?acl=/*1054559_h264_1500k.mp4), hlsdemux is incorrectly converting the relative URLs of the media playlists in to absolute URLs. It is incorrectly using the last '/' it finds in the URL. Using the above example master m3u8, a relative media playlist url of "media.m3u8" is being incorrectly resolved as: http://example.net/1054559_h264_1500k.mp4/master.m3u8?acl=/media.m3u8 It should be: http://example.net/1054559_h264_1500k.mp4/media.m3u8 According to RFC3986 the '/' character is allowed in the query part of the URL.
Created attachment 270261 [details] [review] add support for query parameters Add support for query parameters to uri_join. I wonder if we should move uri_join out of m3u8.c and add a new GstUriHandler function? Joining a relative URL with an absolute URL seems like a fairly generic bit of URL handling. Bug #698155 has some handy unit tests for URLs that we might be able to rebase to git head.
Comment on attachment 270261 [details] [review] add support for query parameters Thanks, looks good. Will merge it later :)
commit 91775a1abd432d3c5a18036054e90fecc86fbb99 Author: Alex Ashley <bugzilla@ashley-family.net> Date: Fri Feb 21 09:30:49 2014 +0000 hlsdemux: Fix for URLs that contain a '/' in the query parameter If the URL for the master manifest files contains a '/' character in the query parameter (for example http://example.net/1054559_h264_1500k.mp4/master.m3u8?acl=/*1054559_h264_1500k.mp4), hlsdemux is incorrectly converting the relative URLs of the media playlists in to absolute URLs. It is incorrectly using the last '/' it finds in the URL. According to RFC3986 the '/' character is allowed in the query part of the URL. https://bugzilla.gnome.org/show_bug.cgi?id=725137