summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWim Taymans <wim.taymans@collabora.co.uk>2009-05-25 13:46:29 +0200
committerWim Taymans <wim.taymans@collabora.co.uk>2009-05-25 13:46:29 +0200
commit269f3ff1a270e1c3cd9b6204c7171d47eb7dfbf1 (patch)
treee57918fa5c38ec3be1e033a21ef93b5eda33a587
parent1abaa6f78cfa1040bd3d0229ed5b035f3793bea7 (diff)
downloadgst-plugins-bad-269f3ff1a270e1c3cd9b6204c7171d47eb7dfbf1.tar.gz
gst-plugins-bad-269f3ff1a270e1c3cd9b6204c7171d47eb7dfbf1.tar.bz2
gst-plugins-bad-269f3ff1a270e1c3cd9b6204c7171d47eb7dfbf1.zip
rtpbin: remove ptdemux ghostpads
-rw-r--r--gst/rtpmanager/gstrtpbin.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/gst/rtpmanager/gstrtpbin.c b/gst/rtpmanager/gstrtpbin.c
index 017ffc02..19de4f1b 100644
--- a/gst/rtpmanager/gstrtpbin.c
+++ b/gst/rtpmanager/gstrtpbin.c
@@ -306,6 +306,8 @@ struct _GstRtpBinStream
gulong demux_newpad_sig;
gulong demux_ptreq_sig;
gulong demux_pt_change_sig;
+ /* ghostpads from the ptdemuxer */
+ GSList *pads;
/* if we have calculated a valid unix_delta for this stream */
gboolean have_sync;
@@ -1169,6 +1171,7 @@ static void
free_stream (GstRtpBinStream * stream)
{
GstRtpBinSession *session;
+ GSList *walk;
session = stream->session;
@@ -1184,6 +1187,14 @@ free_stream (GstRtpBinStream * stream)
gst_bin_remove (GST_BIN_CAST (session->bin), stream->buffer);
gst_bin_remove (GST_BIN_CAST (session->bin), stream->demux);
+ for (walk = stream->pads; walk; walk = g_slist_next (walk)) {
+ GstPad *gpad = GST_PAD_CAST (walk->data);
+
+ gst_pad_set_active (gpad, FALSE);
+ gst_element_remove_pad (GST_ELEMENT_CAST (session->bin), gpad);
+ }
+ g_slist_free (stream->pads);
+
g_free (stream);
}
@@ -1880,6 +1891,8 @@ new_payload_found (GstElement * element, guint pt, GstPad * pad,
gst_pad_set_active (gpad, TRUE);
gst_element_add_pad (GST_ELEMENT_CAST (rtpbin), gpad);
+ stream->pads = g_slist_prepend (stream->pads, gpad);
+
GST_RTP_BIN_SHUTDOWN_UNLOCK (rtpbin);
return;