From e9e9d82fbee587a70cac939c5422c7b20e12cd25 Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Thu, 5 Mar 2009 15:42:23 -0800 Subject: [PATCH] decodebin2: don't stay connected to notify::caps after negotiation Disconnect the notify::caps signal in our callback (it'll be re-added if we're not, in fact, finished getting complete caps). Ensures that caps changes mid-stream (e.g. from an mp3 that changes from stereo->mono mid-file) don't cause us to try to add a new pad. --- gst/playback/gstdecodebin2.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/gst/playback/gstdecodebin2.c b/gst/playback/gstdecodebin2.c index 07b6c8c351..a2615cfdf8 100644 --- a/gst/playback/gstdecodebin2.c +++ b/gst/playback/gstdecodebin2.c @@ -1538,6 +1538,10 @@ caps_notify_cb (GstPad * pad, GParamSpec * unused, GstDecodeBin * dbin) GST_LOG_OBJECT (dbin, "Notified caps for pad %s:%s", GST_DEBUG_PAD_NAME (pad)); + /* Disconnect this; if we still need it, we'll reconnect to this in + * analyze_new_pad */ + g_signal_handlers_disconnect_by_func (pad, caps_notify_cb, dbin); + element = GST_ELEMENT_CAST (gst_pad_get_parent (pad)); pad_added_cb (element, pad, dbin); @@ -1552,6 +1556,10 @@ caps_notify_group_cb (GstPad * pad, GParamSpec * unused, GstDecodeGroup * group) GST_LOG_OBJECT (pad, "Notified caps for pad %s:%s", GST_DEBUG_PAD_NAME (pad)); + /* Disconnect this; if we still need it, we'll reconnect to this in + * analyze_new_pad */ + g_signal_handlers_disconnect_by_func (pad, caps_notify_group_cb, group); + element = GST_ELEMENT_CAST (gst_pad_get_parent (pad)); pad_added_group_cb (element, pad, group);