GNOME Bugzilla – Bug 545352
gsturi is too restrictive
Last modified: 2008-07-31 17:19:39 UTC
gsturi.c treats a URI as a 'protocol' + "://" + 'location'. This is fine for some URI schemes, but not in general. I have a patch (to be contributed) that lets mozilla's URL handlers be used as a gstreamer source. Amongst others, this means a "jar:" scheme URI can be used. This looks like: "jar:file:///tmp/test.zip!/test.ogg" - the scheme is "jar". gsturi currently thinks the scheme is "jar:file", which is incorrect. Patch coming to make this more generic: accepting any ":" as the separator, not requiring "://".
Created attachment 115510 [details] [review] More generic URI handling Mostly, this patch just makes gsturi accept ":" instead of "://", so it's more generic. The more controversial part is the last bit. Currently the code in gst_uri_handler_set_uri() pulls apart the URI, then puts it back together with some mangling done by gst_uri_get_location(). There is no justification given for this mangling in the documentation, and so I have no real idea why it's being done. It looks incorrect to me though, regardless of this patch. So, I change it to pull out the scheme using gst_uri_get_protocol() (which mostly just canonicalises the URI scheme to lower case), and then append the rest of the URI.
The gst_uri_get_location() was added by me IIRC at the time I made the URI code case insensitive regarding the scheme. IMHO your patch and can be committed.
2008-07-31 Michael Smith <msmith@songbirdnest.com> * gst/gsturi.c: Be more liberal in what URIs we accept. Do not unescape bits of the URI for no apparent reason before passing to the element. Fixes #545352.