summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian@centricular.com>2014-08-13 17:22:16 +0300
committerSebastian Dröge <sebastian@centricular.com>2014-08-25 10:39:04 +0300
commit1b47b6d9b03bf93c3e5b0a2885c51851ef61d1e6 (patch)
tree5e1d5316f404aba5d74b001960826279bbd2b13c
parent6ba5ca447f40bc05ac74c2ab805d1ce9cf77797a (diff)
rtsp-stream: Remove the multicast group udp sources when removing from the bin
-rw-r--r--gst/rtsp-server/rtsp-stream.c21
1 files changed, 21 insertions, 0 deletions
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;