mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-22 14:06:23 +00:00
media: cleanup media transport before freeing
Cleanup the media transport data before freeing. In particular, remove the qdata from the rtpsource object.
This commit is contained in:
parent
dc33070da3
commit
450b68252f
3 changed files with 18 additions and 2 deletions
|
@ -171,6 +171,19 @@ free_destination (RTSPDestination *dest)
|
|||
g_slice_free (RTSPDestination, dest);
|
||||
}
|
||||
|
||||
void
|
||||
gst_rtsp_media_trans_cleanup (GstRTSPMediaTrans *trans)
|
||||
{
|
||||
if (trans->transport) {
|
||||
gst_rtsp_transport_free (trans->transport);
|
||||
trans->transport = NULL;
|
||||
}
|
||||
if (trans->rtpsource) {
|
||||
g_object_set_qdata (trans->rtpsource, ssrc_stream_map_key, NULL);
|
||||
trans->rtpsource = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gst_rtsp_media_stream_free (GstRTSPMediaStream * stream)
|
||||
{
|
||||
|
@ -855,6 +868,7 @@ cleanup:
|
|||
}
|
||||
}
|
||||
|
||||
/* executed from streaming thread */
|
||||
static void
|
||||
caps_notify (GstPad * pad, GParamSpec * unused, GstRTSPMediaStream * stream)
|
||||
{
|
||||
|
@ -1408,6 +1422,7 @@ bus_message (GstBus * bus, GstMessage * message, GstRTSPMedia * media)
|
|||
return ret;
|
||||
}
|
||||
|
||||
/* called from streaming threads */
|
||||
static void
|
||||
pad_added_cb (GstElement * element, GstPad * pad, GstRTSPMedia * media)
|
||||
{
|
||||
|
|
|
@ -288,6 +288,8 @@ gboolean gst_rtsp_media_set_state (GstRTSPMedia *media, GstS
|
|||
|
||||
void gst_rtsp_media_remove_elements (GstRTSPMedia *media);
|
||||
|
||||
void gst_rtsp_media_trans_cleanup (GstRTSPMediaTrans *trans);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GST_RTSP_MEDIA_H__ */
|
||||
|
|
|
@ -82,8 +82,7 @@ gst_rtsp_session_free_stream (GstRTSPSessionStream * stream)
|
|||
gst_rtsp_session_stream_set_callbacks (stream, NULL, NULL, NULL, NULL);
|
||||
gst_rtsp_session_stream_set_keepalive (stream, NULL, NULL, NULL);
|
||||
|
||||
if (stream->trans.transport)
|
||||
gst_rtsp_transport_free (stream->trans.transport);
|
||||
gst_rtsp_media_trans_cleanup (&stream->trans);
|
||||
|
||||
g_free (stream);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue