mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-13 12:51:16 +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
ccfb99f852
commit
ae67971cde
2 changed files with 6 additions and 3 deletions
|
@ -1096,19 +1096,22 @@ create_sdp (GstRTSPClient * client, GstRTSPMedia * media)
|
|||
|
||||
info.server_proto = proto;
|
||||
if (media->protocols & GST_RTSP_LOWER_TRANS_UDP_MCAST)
|
||||
info.server_ip = MCAST_ADDRESS;
|
||||
info.server_ip = g_strdup (MCAST_ADDRESS);
|
||||
else
|
||||
info.server_ip = client->server_ip;
|
||||
info.server_ip = g_strdup (client->server_ip);
|
||||
|
||||
/* create an SDP for the media object */
|
||||
if (!gst_rtsp_sdp_from_media (sdp, &info, media))
|
||||
goto no_sdp;
|
||||
|
||||
g_free (info.server_ip);
|
||||
|
||||
return sdp;
|
||||
|
||||
/* ERRORS */
|
||||
no_sdp:
|
||||
{
|
||||
g_free (info.server_ip);
|
||||
gst_sdp_message_free (sdp);
|
||||
return NULL;
|
||||
}
|
||||
|
|
|
@ -29,7 +29,7 @@ G_BEGIN_DECLS
|
|||
|
||||
typedef struct {
|
||||
const gchar *server_proto;
|
||||
const gchar *server_ip;
|
||||
gchar *server_ip;
|
||||
} GstSDPInfo;
|
||||
|
||||
/* creating SDP */
|
||||
|
|
Loading…
Reference in a new issue