summaryrefslogtreecommitdiffstats
path: root/gst/rtpmux
diff options
context:
space:
mode:
authorOlivier CrĂȘte <olivier.crete@collabora.co.uk>2009-04-15 13:15:55 -0400
committerOlivier CrĂȘte <olivier.crete@collabora.co.uk>2009-04-15 13:15:55 -0400
commit66fca81e23a63919255d7ca71b601a5dfeff4ea3 (patch)
treee74535b42b5928c63e1046523fe860d7199d38fd /gst/rtpmux
parent65cb85316bec86391fd235adf15716f44230e646 (diff)
downloadgst-plugins-bad-66fca81e23a63919255d7ca71b601a5dfeff4ea3.tar.gz
gst-plugins-bad-66fca81e23a63919255d7ca71b601a5dfeff4ea3.tar.bz2
gst-plugins-bad-66fca81e23a63919255d7ca71b601a5dfeff4ea3.zip
rtpdtmfmux: Release locked pad on release_pad
Release the special pad if the pad is removed from the muxer.
Diffstat (limited to 'gst/rtpmux')
-rw-r--r--gst/rtpmux/gstrtpdtmfmux.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/gst/rtpmux/gstrtpdtmfmux.c b/gst/rtpmux/gstrtpdtmfmux.c
index 50fdba48..da10130c 100644
--- a/gst/rtpmux/gstrtpdtmfmux.c
+++ b/gst/rtpmux/gstrtpdtmfmux.c
@@ -90,6 +90,8 @@ static void gst_rtp_dtmf_mux_base_init (gpointer g_class);
static void gst_rtp_dtmf_mux_class_init (GstRTPDTMFMuxClass * klass);
static void gst_rtp_dtmf_mux_dispose (GObject * object);
+static void gst_rtp_mux_release_pad (GstElement * element, GstPad * pad);
+
static gboolean gst_rtp_dtmf_mux_sink_event (GstPad * pad, GstEvent * event);
static GstFlowReturn gst_rtp_dtmf_mux_chain (GstPad * pad, GstBuffer * buffer);
@@ -152,6 +154,7 @@ gst_rtp_dtmf_mux_class_init (GstRTPDTMFMuxClass * klass)
gst_marshal_VOID__OBJECT, G_TYPE_NONE, 1, GST_TYPE_PAD);
gobject_class->dispose = gst_rtp_dtmf_mux_dispose;
+ gstelement_class->release_pad = gst_rtp_mux_release_pad;
gstrtpmux_class->chain_func = gst_rtp_dtmf_mux_chain;
gstrtpmux_class->sink_event_func = gst_rtp_dtmf_mux_sink_event;
}
@@ -319,6 +322,21 @@ gst_rtp_dtmf_mux_sink_event (GstPad * pad, GstEvent * event)
return ret;
}
+static void
+gst_rtp_mux_release_pad (GstElement * element, GstPad * pad)
+{
+ GstRTPDTMFMux *mux = GST_RTP_DTMF_MUX (element);
+
+ GST_OBJECT_LOCK (mux);
+ if (mux->special_pad == pad) {
+ gst_object_unref (mux->special_pad);
+ mux->special_pad = NULL;
+ }
+ GST_OBJECT_UNLOCK (mux);
+
+ GST_CALL_PARENT (GST_ELEMENT_CLASS, release_pad, (element, pad));
+}
+
gboolean
gst_rtp_dtmf_mux_plugin_init (GstPlugin * plugin)
{