From 0a2a0fc34494c50130b5868baa0d66f96d7fb532 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sebastian=20Dr=C3=B6ge?= Date: Thu, 6 May 2010 09:51:15 +0200 Subject: [PATCH] mmssrc: Use the escaped location for the RTSP redirect message gst_uri_get_location() unescapes the location, which could result in an invalid RTSP URI. --- ext/libmms/gstmms.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ext/libmms/gstmms.c b/ext/libmms/gstmms.c index 9ff19d0..23a5226 100644 --- a/ext/libmms/gstmms.c +++ b/ext/libmms/gstmms.c @@ -439,9 +439,10 @@ gst_mms_start (GstBaseSrc * bsrc) GST_ERROR_OBJECT (mms, "Could not connect to this stream, redirecting to rtsp"); - location = gst_uri_get_location (mms->uri_name); - url = g_strdup_printf ("rtsp://%s", location); - g_free (location); + location = strstr (mms->uri_name, "://"); + if (location == NULL || *location == '\0' || *(location + 3) == '\0') + goto no_uri; + url = g_strdup_printf ("rtsp://%s", location + 3); gst_element_post_message (GST_ELEMENT_CAST (mms), gst_message_new_element (GST_OBJECT_CAST (mms), -- 2.7.4