media-factory: don't use host for shared hash key
authorWim Taymans <wim.taymans@collabora.co.uk>
Thu, 23 Sep 2010 09:32:58 +0000 (11:32 +0200)
committerWim Taymans <wim.taymans@collabora.co.uk>
Thu, 23 Sep 2010 09:35:40 +0000 (11:35 +0200)
When we generate the key to share made between connections, don't include the
host used to connect so that we can share media even if between clients that
connected with localhost and ones with the ip address.

gst/rtsp-server/rtsp-media-factory.c

index 92591aa..9eaddb7 100644 (file)
@@ -413,8 +413,13 @@ static gchar *
 default_gen_key (GstRTSPMediaFactory *factory, const GstRTSPUrl *url)
 {
   gchar *result;
+  const gchar *pre_query;
+  const gchar *query;
 
-  result = gst_rtsp_url_get_request_uri ((GstRTSPUrl *)url);
+  pre_query = url->query ? "?" : "";
+  query = url->query ? url->query : "";
+
+  result = g_strdup_printf ("%u%s%s%s", url->port, url->abspath, pre_query, query);
 
   return result;
 }