[gst-cvs] gst-plugins-base: decodebin2: don't stay connected to notify:: caps after negotiation

Michael Smith msmith at kemper.freedesktop.org
Thu Mar 5 15:45:12 PST 2009


Module: gst-plugins-base
Branch: master
Commit: e9e9d82fbee587a70cac939c5422c7b20e12cd25
URL:    http://cgit.freedesktop.org/gstreamer/gst-plugins-base/commit/?id=e9e9d82fbee587a70cac939c5422c7b20e12cd25

Author: Michael Smith <msmith at songbirdnest.com>
Date:   Thu Mar  5 15:42:23 2009 -0800

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 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/gst/playback/gstdecodebin2.c b/gst/playback/gstdecodebin2.c
index 07b6c8c..a2615cf 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);





More information about the Gstreamer-commits mailing list