From: Sebastian Dröge Date: Wed, 13 Aug 2014 14:22:16 +0000 (+0300) Subject: rtsp-stream: Remove the multicast group udp sources when removing from the bin X-Git-Tag: 1.6.0~151 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1b47b6d9b03bf93c3e5b0a2885c51851ef61d1e6;p=platform%2Fupstream%2Fgst-rtsp-server.git rtsp-stream: Remove the multicast group udp sources when removing from the bin --- diff --git a/gst/rtsp-server/rtsp-stream.c b/gst/rtsp-server/rtsp-stream.c index 0b02570..68d7bec 100644 --- a/gst/rtsp-server/rtsp-stream.c +++ b/gst/rtsp-server/rtsp-stream.c @@ -1949,6 +1949,7 @@ gst_rtsp_stream_leave_bin (GstRTSPStream * stream, GstBin * bin, { GstRTSPStreamPrivate *priv; gint i; + GList *l; g_return_val_if_fail (GST_IS_RTSP_STREAM (stream), FALSE); g_return_val_if_fail (GST_IS_BIN (bin), FALSE); @@ -1999,6 +2000,18 @@ gst_rtsp_stream_leave_bin (GstRTSPStream * stream, GstBin * bin, gst_element_set_state (priv->udpsrc_v6[i], GST_STATE_NULL); gst_bin_remove (bin, priv->udpsrc_v6[i]); } + + for (l = priv->transport_sources; l; l = l->next) { + GstRTSPMulticastTransportSource *s = l->data; + + if (!s->udpsrc[i]) + continue; + + gst_element_set_locked_state (s->udpsrc[i], FALSE); + gst_element_set_state (s->udpsrc[i], GST_STATE_NULL); + gst_bin_remove (bin, s->udpsrc[i]); + } + if (priv->udpsink[i]) gst_bin_remove (bin, priv->udpsink[i]); if (priv->appsrc[i]) @@ -2025,6 +2038,14 @@ gst_rtsp_stream_leave_bin (GstRTSPStream * stream, GstBin * bin, priv->tee[i] = NULL; priv->funnel[i] = NULL; } + + for (l = priv->transport_sources; l; l = l->next) { + GstRTSPMulticastTransportSource *s = l->data; + g_slice_free (GstRTSPMulticastTransportSource, s); + } + g_list_free (priv->transport_sources); + priv->transport_sources = NULL; + gst_object_unref (priv->send_src[0]); priv->send_src[0] = NULL;