* The connection will not yet attempt to connect to @url, use
* gst_rtsp_connection_connect().
*
+ * A copy of @url will be made.
+ *
* Returns: #GST_RTSP_OK when @conn contains a valid connection.
*/
GstRTSPResult
-gst_rtsp_connection_create (GstRTSPUrl * url, GstRTSPConnection ** conn)
+gst_rtsp_connection_create (const GstRTSPUrl * url, GstRTSPConnection ** conn)
{
GstRTSPConnection *newconn;
#ifdef G_OS_WIN32
if ((newconn->fdset = gst_poll_new (TRUE)) == NULL)
goto no_fdset;
- newconn->url = url;
+ newconn->url = gst_rtsp_url_copy (url);
newconn->fd0.fd = -1;
newconn->fd1.fd = -1;
newconn->timer = g_timer_new ();
/* now create the connection object */
gst_rtsp_connection_create (url, &newconn);
+ gst_rtsp_url_free (url);
+
ADD_POLLFD (newconn->fdset, &newconn->fd0, fd);
/* both read and write initially */
g_free (conn->username);
g_free (conn->passwd);
gst_rtsp_connection_clear_auth_params (conn);
+ gst_rtsp_url_free (conn->url);
g_free (conn);
#ifdef G_OS_WIN32
WSACleanup ();
typedef struct _GstRTSPConnection GstRTSPConnection;
/* opening/closing a connection */
-GstRTSPResult gst_rtsp_connection_create (GstRTSPUrl *url, GstRTSPConnection **conn);
+GstRTSPResult gst_rtsp_connection_create (const GstRTSPUrl *url, GstRTSPConnection **conn);
GstRTSPResult gst_rtsp_connection_accept (gint sock, GstRTSPConnection **conn);
GstRTSPResult gst_rtsp_connection_connect (GstRTSPConnection *conn, GTimeVal *timeout);
GstRTSPResult gst_rtsp_connection_close (GstRTSPConnection *conn);