encodebin: Return a new reference of the pad for the "request-pad" signal
authorSebastian Dröge <sebastian.droege@collabora.co.uk>
Thu, 24 Feb 2011 14:55:00 +0000 (15:55 +0100)
committerSebastian Dröge <sebastian.droege@collabora.co.uk>
Thu, 24 Feb 2011 14:55:00 +0000 (15:55 +0100)
The GObject signal code assumes that the signal handlers return a
new reference or copy. Fixes bug #641927.

gst/encoding/gstencodebin.c

index 0ca3981..c1a0e8b 100644 (file)
@@ -670,7 +670,9 @@ gst_encode_bin_request_new_pad (GstElement * element,
 static GstPad *
 gst_encode_bin_request_pad_signal (GstEncodeBin * encodebin, GstCaps * caps)
 {
-  return request_pad_for_stream (encodebin, G_TYPE_NONE, NULL, caps);
+  GstPad *pad = request_pad_for_stream (encodebin, G_TYPE_NONE, NULL, caps);
+
+  return pad ? GST_PAD_CAST (gst_object_ref (pad)) : NULL;
 }
 
 static inline StreamGroup *