GstRTSPClientPrivate *priv = client->priv;
GstRTSPMediaFactory *factory;
GstRTSPMedia *media;
+ GstRTSPUrl *url;
gint path_len;
/* find the longest matching factory for the uri first */
else
path_len = strlen (path);
+ url = gst_rtsp_url_copy (ctx->uri);
+ /* normalize rtsp://<IP>:<PORT> to rtsp://<IP>:<PORT>/ */
+ if (url->abspath[0] == 0) {
+ g_free (url->abspath);
+ url->abspath = g_strdup ("/");
+ }
+
if (!paths_are_equal (priv->path, path, path_len)) {
/* remove any previously cached values before we try to construct a new
* media for uri */
clean_cached_media (client, TRUE);
/* prepare the media and add it to the pipeline */
- if (!(media = gst_rtsp_media_factory_construct (factory, ctx->uri)))
+ if (!(media = gst_rtsp_media_factory_construct (factory, url)))
goto no_media;
ctx->media = media;
GST_INFO ("reusing cached media %p for path %s", media, priv->path);
}
+ gst_rtsp_url_free (url);
g_object_unref (factory);
ctx->factory = NULL;
{
GST_ERROR ("client %p: can't create media", client);
send_generic_response (client, GST_RTSP_STS_BAD_REQUEST, ctx);
+ gst_rtsp_url_free (url);
g_object_unref (factory);
ctx->factory = NULL;
return NULL;
{
GST_ERROR ("client %p: can't create thread", client);
send_generic_response (client, GST_RTSP_STS_SERVICE_UNAVAILABLE, ctx);
+ gst_rtsp_url_free (url);
g_object_unref (media);
ctx->media = NULL;
g_object_unref (factory);
{
GST_ERROR ("client %p: can't prepare media", client);
send_generic_response (client, GST_RTSP_STS_SERVICE_UNAVAILABLE, ctx);
+ gst_rtsp_url_free (url);
g_object_unref (media);
ctx->media = NULL;
g_object_unref (factory);