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.
This commit is contained in:
Michael Smith 2009-03-05 15:42:23 -08:00
parent f69a3d953a
commit e9e9d82fbe

View file

@ -1538,6 +1538,10 @@ caps_notify_cb (GstPad * pad, GParamSpec * unused, GstDecodeBin * dbin)
GST_LOG_OBJECT (dbin, "Notified caps for pad %s:%s", GST_LOG_OBJECT (dbin, "Notified caps for pad %s:%s",
GST_DEBUG_PAD_NAME (pad)); 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)); element = GST_ELEMENT_CAST (gst_pad_get_parent (pad));
pad_added_cb (element, pad, dbin); 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)); 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)); element = GST_ELEMENT_CAST (gst_pad_get_parent (pad));
pad_added_group_cb (element, pad, group); pad_added_group_cb (element, pad, group);