From: Wim Taymans Date: Tue, 24 Aug 2010 14:47:30 +0000 (+0200) Subject: media: cleanup media transport before freeing X-Git-Tag: 1.19.3~495^2~1454 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=450b68252f4fe9d4c5aa5e566810a919611e0371;p=platform%2Fupstream%2Fgstreamer.git media: cleanup media transport before freeing Cleanup the media transport data before freeing. In particular, remove the qdata from the rtpsource object. --- diff --git a/gst/rtsp-server/rtsp-media.c b/gst/rtsp-server/rtsp-media.c index 02a9317..c6a45ac 100644 --- a/gst/rtsp-server/rtsp-media.c +++ b/gst/rtsp-server/rtsp-media.c @@ -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) { diff --git a/gst/rtsp-server/rtsp-media.h b/gst/rtsp-server/rtsp-media.h index 9f62074..211e2c0 100644 --- a/gst/rtsp-server/rtsp-media.h +++ b/gst/rtsp-server/rtsp-media.h @@ -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__ */ diff --git a/gst/rtsp-server/rtsp-session.c b/gst/rtsp-server/rtsp-session.c index 7df6c37..f435446 100644 --- a/gst/rtsp-server/rtsp-session.c +++ b/gst/rtsp-server/rtsp-session.c @@ -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); }