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 797146 - uri: fix roundtrip for file:// URIs
uri: fix roundtrip for file:// URIs
Status: RESOLVED OBSOLETE
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
git master
Other Linux
: Normal minor
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2018-09-14 17:46 UTC by Tim-Philipp Müller
Modified: 2018-11-03 12:48 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
uri: fix roundtrip for file:// uris (1.91 KB, patch)
2018-09-14 17:46 UTC, Tim-Philipp Müller
reviewed Details | Review

Description Tim-Philipp Müller 2018-09-14 17:46:00 UTC
Created attachment 373661 [details] [review]
uri: fix roundtrip for file:// uris

uri = gst_uri_from_string ("file:///path/to/foo.bar");
  string = gst_uri_to_string (uri);

would return "file:/path/to/foo.bar".

Slashes get lost somewhere.

Setting the hostname to "" after gst_uri_from_string() "fixes" it.

Attached patch fixes it also without making any of the other unit tests fail, but it's pretty much cargo-culted without real understanding.

Question is if this is something that needs to be fixed serialisation-side or parsing-side I guess.
Comment 1 Sebastian Dröge (slomo) 2018-09-17 07:30:35 UTC
Review of attachment 373661 [details] [review]:

::: gst/gsturi.c
@@ +1958,3 @@
+          uri->port != GST_URI_NO_PORT) || (uri->userinfo == NULL
+          && uri->host == NULL && uri->port == GST_URI_NO_PORT
+          && uri->scheme != NULL))

From your fix it seems like a problem on the serialization side. The fields of the URI are all set correctly when parsing file URIs it seems?

Just unclear if these are *all* the cases where a // should be appended at this position, and if this is not causing too many // to be added. E.g. "whateverscheme:someid" would also cause // to be added or not, or would parsing put "someid" into the userinfo then?
Comment 2 GStreamer system administrator 2018-11-03 12:48:14 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/gstreamer/gstreamer/issues/312.