diff options
author | Michael Smith <msmith@songbirdnest.com> | 2009-03-05 15:42:23 -0800 |
---|---|---|
committer | Michael Smith <msmith@songbirdnest.com> | 2009-03-05 15:44:17 -0800 |
commit | e9e9d82fbee587a70cac939c5422c7b20e12cd25 (patch) | |
tree | f2d66e94f61af78c790403676bdcd3833c238038 | |
parent | f69a3d953a951fa73fa0e00a281c77bc19bb7ac2 (diff) |
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.
-rw-r--r-- | gst/playback/gstdecodebin2.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/gst/playback/gstdecodebin2.c b/gst/playback/gstdecodebin2.c index 07b6c8c35..a2615cfdf 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); |