--- a/gst-libs/gst/rtsp/gstrtspurl.c	2014-07-21 09:22:55.000000000 +0100
+++ b/gst-libs/gst/rtsp/gstrtspurl.c	2015-11-20 10:36:53.840321700 +0000
@@ -55,6 +55,9 @@
 G_DEFINE_BOXED_TYPE (GstRTSPUrl, gst_rtsp_url,
     (GBoxedCopyFunc) gst_rtsp_url_copy, (GBoxedFreeFunc) gst_rtsp_url_free);
 
+gchar gst_rtsp_url_from_hex (gchar c);
+gchar *gst_rtsp_url_decode_hex_usrpwd (gchar * usrpwd, guint len);
+
 static const struct
 {
   const char scheme[6];
@@ -77,6 +80,35 @@ static const struct
         GST_RTSP_LOWER_TRANS_TLS}
 };
 
+gchar
+gst_rtsp_url_from_hex (gchar c)
+{
+  return g_ascii_isdigit (c) ? c - '0' : g_ascii_tolower (c) - 'a' + 10;
+}
+
+gchar *
+gst_rtsp_url_decode_hex_usrpwd (gchar * usrpwd, guint len)
+{
+  gchar *buf = g_malloc (strlen (usrpwd) + 1);
+  gchar *pbuf = buf;
+  guint i = 0;
+
+  while (i < len) {
+    if (usrpwd[i] == '%') {
+      if (usrpwd[i + 1] && usrpwd[i + 2]) {
+        *pbuf++ = (gst_rtsp_url_from_hex (usrpwd[i + 1]) << 4 |
+            gst_rtsp_url_from_hex (usrpwd[i + 2]));
+        i += 2;
+      }
+    } else {
+      *pbuf++ = usrpwd[i];
+    }
+    i++;
+  }
+  *pbuf = '\0';
+  return buf;
+}
+
 /* format is rtsp[u]://[user:passwd@]host[:port]/abspath[?query] where host
  * is a host name, an IPv4 dotted decimal address ("aaa.bbb.ccc.ddd") or an
  * [IPv6] address ("[aabb:ccdd:eeff:gghh::sstt]" note the brackets around the
@@ -136,9 +170,9 @@ gst_rtsp_url_parse (const gchar * urlstr
     if (col == NULL || col > at)
       goto invalid;
 
-    res->user = g_strndup (p, col - p);
+    res->user = gst_rtsp_url_decode_hex_usrpwd (p, col - p);
     col++;
-    res->passwd = g_strndup (col, at - col);
+    res->passwd = gst_rtsp_url_decode_hex_usrpwd (col, at - col);
 
     /* move to host */
     p = at + 1;
