mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-13 02:45:35 +00:00
sdp: copy and free the server ip address
Copy and free the server ip address to make memory management easier later.
This commit is contained in:
parent
647e8c7af8
commit
a5e028ba72
2 changed files with 6 additions and 3 deletions
|
@ -1096,19 +1096,22 @@ create_sdp (GstRTSPClient * client, GstRTSPMedia * media)
|
||||||
|
|
||||||
info.server_proto = proto;
|
info.server_proto = proto;
|
||||||
if (media->protocols & GST_RTSP_LOWER_TRANS_UDP_MCAST)
|
if (media->protocols & GST_RTSP_LOWER_TRANS_UDP_MCAST)
|
||||||
info.server_ip = MCAST_ADDRESS;
|
info.server_ip = g_strdup (MCAST_ADDRESS);
|
||||||
else
|
else
|
||||||
info.server_ip = client->server_ip;
|
info.server_ip = g_strdup (client->server_ip);
|
||||||
|
|
||||||
/* create an SDP for the media object */
|
/* create an SDP for the media object */
|
||||||
if (!gst_rtsp_sdp_from_media (sdp, &info, media))
|
if (!gst_rtsp_sdp_from_media (sdp, &info, media))
|
||||||
goto no_sdp;
|
goto no_sdp;
|
||||||
|
|
||||||
|
g_free (info.server_ip);
|
||||||
|
|
||||||
return sdp;
|
return sdp;
|
||||||
|
|
||||||
/* ERRORS */
|
/* ERRORS */
|
||||||
no_sdp:
|
no_sdp:
|
||||||
{
|
{
|
||||||
|
g_free (info.server_ip);
|
||||||
gst_sdp_message_free (sdp);
|
gst_sdp_message_free (sdp);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,7 +29,7 @@ G_BEGIN_DECLS
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
const gchar *server_proto;
|
const gchar *server_proto;
|
||||||
const gchar *server_ip;
|
gchar *server_ip;
|
||||||
} GstSDPInfo;
|
} GstSDPInfo;
|
||||||
|
|
||||||
/* creating SDP */
|
/* creating SDP */
|
||||||
|
|
Loading…
Reference in a new issue