After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 545352 - gsturi is too restrictive
gsturi is too restrictive
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
git master
Other Linux
: Normal normal
: 0.10.21
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2008-07-29 17:44 UTC by Michael Smith
Modified: 2008-07-31 17:19 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
More generic URI handling (1.89 KB, patch)
2008-07-29 17:47 UTC, Michael Smith
committed Details | Review

Description Michael Smith 2008-07-29 17:44:24 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 "://".
Comment 1 Michael Smith 2008-07-29 17:47:56 UTC
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.
Comment 2 Sebastian Dröge (slomo) 2008-07-31 14:40:39 UTC
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.
Comment 3 Michael Smith 2008-07-31 17:19:39 UTC
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.