summaryrefslogtreecommitdiffstats
path: root/gst/rtpmux/gstrtpdtmfmux.c
diff options
context:
space:
mode:
authorOlivier CrĂȘte <olivier.crete@collabora.co.uk>2009-04-15 13:15:55 -0400
committerDave Robillard <dave@drobilla.net>2009-05-03 12:03:15 -0400
commit6100b2edab52c9fd01293e4d56bd1e9d452be0af (patch)
tree743ba3bddb0ba640f43b20b4637b68ab442f6971 /gst/rtpmux/gstrtpdtmfmux.c
parentd517dfdbb59b695b76580392ef1d89c9b7fe4391 (diff)
downloadgst-plugins-bad-6100b2edab52c9fd01293e4d56bd1e9d452be0af.tar.gz
gst-plugins-bad-6100b2edab52c9fd01293e4d56bd1e9d452be0af.tar.bz2
gst-plugins-bad-6100b2edab52c9fd01293e4d56bd1e9d452be0af.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/gstrtpdtmfmux.c')
-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)
{