From a913a0b9679dd58945ad105d240db45595fdaba6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Mon, 13 Jun 2016 09:20:22 +0300 Subject: [PATCH] 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 --- sys/applemedia/avfassetsrc.m | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/sys/applemedia/avfassetsrc.m b/sys/applemedia/avfassetsrc.m index 873104745b..e589cf3f4a 100644 --- a/sys/applemedia/avfassetsrc.m +++ b/sys/applemedia/avfassetsrc.m @@ -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;