gst_rtsp_connection_close (priv->connection);
}
+static gchar *
+make_path_from_uri (GstRTSPClient * client, GstRTSPUrl * uri)
+{
+ gchar *path;
+
+ if (uri->query)
+ path = g_strconcat (uri->abspath, "?", uri->query, NULL);
+ else
+ path = g_strdup (uri->abspath);
+
+ return path;
+}
+
static gboolean
handle_teardown_request (GstRTSPClient * client, GstRTSPContext * ctx)
{
GstRTSPSession *session;
GstRTSPSessionMedia *sessmedia;
GstRTSPStatusCode code;
- const gchar *path;
+ gchar *path;
gint matched;
if (!ctx->session)
if (!ctx->uri)
goto no_uri;
- path = ctx->uri->abspath;
+ path = make_path_from_uri (client, ctx->uri);
/* get a handle to the configuration of the media in the session */
sessmedia = gst_rtsp_session_get_media (session, path, &matched);
if (path[matched] != '\0')
goto no_aggregate;
+ g_free (path);
+
ctx->sessmedia = sessmedia;
/* we emit the signal before closing the connection */
{
GST_ERROR ("client %p: no media for uri", client);
send_generic_response (client, GST_RTSP_STS_NOT_FOUND, ctx);
+ g_free (path);
return FALSE;
}
no_aggregate:
GST_ERROR ("client %p: no aggregate path %s", client, path);
send_generic_response (client,
GST_RTSP_STS_ONLY_AGGREGATE_OPERATION_ALLOWED, ctx);
+ g_free (path);
return FALSE;
}
}
GstRTSPSessionMedia *sessmedia;
GstRTSPStatusCode code;
GstRTSPState rtspstate;
- const gchar *path;
+ gchar *path;
gint matched;
if (!(session = ctx->session))
if (!ctx->uri)
goto no_uri;
- path = ctx->uri->abspath;
+ path = make_path_from_uri (client, ctx->uri);
/* get a handle to the configuration of the media in the session */
sessmedia = gst_rtsp_session_get_media (session, path, &matched);
if (path[matched] != '\0')
goto no_aggregate;
+ g_free (path);
+
ctx->sessmedia = sessmedia;
rtspstate = gst_rtsp_session_media_get_rtsp_state (sessmedia);
{
GST_ERROR ("client %p: no media for uri", client);
send_generic_response (client, GST_RTSP_STS_NOT_FOUND, ctx);
+ g_free (path);
return FALSE;
}
no_aggregate:
GST_ERROR ("client %p: no aggregate path %s", client, path);
send_generic_response (client,
GST_RTSP_STS_ONLY_AGGREGATE_OPERATION_ALLOWED, ctx);
+ g_free (path);
return FALSE;
}
invalid_state:
if (!(uri = ctx->uri))
goto no_uri;
- path = uri->abspath;
+ path = make_path_from_uri (client, uri);
/* get a handle to the configuration of the media in the session */
sessmedia = gst_rtsp_session_get_media (session, path, &matched);
}
}
g_free (base_url);
+ g_free (path);
/* construct the response now */
code = GST_RTSP_STS_OK;
GST_ERROR ("client %p: no aggregate path %s", client, path);
send_generic_response (client,
GST_RTSP_STS_ONLY_AGGREGATE_OPERATION_ALLOWED, ctx);
+ g_free (path);
return FALSE;
}
invalid_state:
GST_ERROR ("client %p: not PLAYING or READY", client);
send_generic_response (client, GST_RTSP_STS_METHOD_NOT_VALID_IN_THIS_STATE,
ctx);
+ g_free (path);
return FALSE;
}
}
goto no_uri;
uri = ctx->uri;
- if (uri->query)
- path = g_strconcat (uri->abspath, "?", uri->query, NULL);
- else
- path = g_strdup (uri->abspath);
+ path = make_path_from_uri (client, uri);
/* parse the transport */
res =