avfassetsrc: Don't escape the URI before passing it to NSURL

The URI must already be escaped by the caller, we don't support passing around
invalid (unescaped) URIs via the GstURIHandler interface.

Also it will escape too much of the URI in this case, e.g.
  ipod-library://item/item.m4a?id=3143338395173862951
becomes
  ipod-library://item/item.m4a%3Fid%3D3143338395173862951

https://bugzilla.gnome.org/show_bug.cgi?id=767492
This commit is contained in:
Sebastian Dröge 2016-06-13 09:20:22 +03:00
parent 0275007107
commit a913a0b967

View file

@ -804,15 +804,12 @@ gst_avf_asset_src_uri_set_uri (GstURIHandler * handler, const gchar * uri, GErro
NSString *str;
NSURL *url;
AVAsset *asset;
gchar *escaped_uri;
gboolean ret = FALSE;
OBJC_CALLOUT_BEGIN ();
escaped_uri = g_uri_escape_string (uri, ":/", TRUE);
str = [NSString stringWithUTF8String: escaped_uri];
str = [NSString stringWithUTF8String: uri];
url = [[NSURL alloc] initWithString: str];
asset = [AVAsset assetWithURL: url];
g_free (escaped_uri);
if (asset.playable) {
ret = TRUE;
@ -820,7 +817,7 @@ gst_avf_asset_src_uri_set_uri (GstURIHandler * handler, const gchar * uri, GErro
self->uri = g_strdup (uri);
} else {
g_set_error (error, GST_URI_ERROR, GST_URI_ERROR_BAD_URI,
"Invalid URI '%s' for avfassetsrc", self->uri);
"Invalid URI '%s' for avfassetsrc", uri);
}
OBJC_CALLOUT_END ();
return ret;