Index: gst/gstutils.c
===================================================================
RCS file: /cvs/gstreamer/gstreamer/gst/gstutils.c,v
retrieving revision 1.133
diff -u -r1.133 gstutils.c
--- gst/gstutils.c	2 Feb 2006 09:51:18 -0000	1.133
+++ gst/gstutils.c	19 Feb 2006 00:17:49 -0000
@@ -2656,6 +2656,13 @@
   g_return_val_if_fail (GST_IS_PAD (pad), 0);
   g_return_val_if_fail (handler != NULL, 0);
 
+  if (GST_IS_GHOST_PAD (pad)) {
+    pad = gst_ghost_pad_get_target (GST_GHOST_PAD (pad));
+    if (!pad) {
+      return 0;
+    }
+  }
+  
   GST_OBJECT_LOCK (pad);
   sigid = g_signal_connect (pad, "have-data", handler, data);
   GST_PAD_DO_EVENT_SIGNALS (pad)++;
@@ -2686,6 +2693,13 @@
 
   g_return_val_if_fail (GST_IS_PAD (pad), 0);
   g_return_val_if_fail (handler != NULL, 0);
+  
+  if (GST_IS_GHOST_PAD (pad)) {
+    pad = gst_ghost_pad_get_target (GST_GHOST_PAD (pad));
+    if (!pad) {
+      return 0;
+    }
+  }
 
   GST_OBJECT_LOCK (pad);
   sigid = g_signal_connect (pad, "have-data::event", handler, data);
@@ -2716,6 +2730,13 @@
   g_return_val_if_fail (GST_IS_PAD (pad), 0);
   g_return_val_if_fail (handler != NULL, 0);
 
+  if (GST_IS_GHOST_PAD (pad)) {
+    pad = gst_ghost_pad_get_target (GST_GHOST_PAD (pad));
+    if (!pad) {
+      return 0;
+    }
+  }
+  
   GST_OBJECT_LOCK (pad);
   sigid = g_signal_connect (pad, "have-data::buffer", handler, data);
   GST_PAD_DO_BUFFER_SIGNALS (pad)++;
@@ -2739,6 +2760,13 @@
   g_return_if_fail (GST_IS_PAD (pad));
   g_return_if_fail (handler_id > 0);
 
+  if (GST_IS_GHOST_PAD (pad)) {
+    pad = gst_ghost_pad_get_target (GST_GHOST_PAD (pad));
+    if (!pad) {
+      return;
+    }
+  }
+  
   GST_OBJECT_LOCK (pad);
   g_signal_handler_disconnect (pad, handler_id);
   GST_PAD_DO_BUFFER_SIGNALS (pad)--;
@@ -2763,6 +2791,13 @@
   g_return_if_fail (GST_IS_PAD (pad));
   g_return_if_fail (handler_id > 0);
 
+  if (GST_IS_GHOST_PAD (pad)) {
+    pad = gst_ghost_pad_get_target (GST_GHOST_PAD (pad));
+    if (!pad) {
+      return;
+    }
+  }
+  
   GST_OBJECT_LOCK (pad);
   g_signal_handler_disconnect (pad, handler_id);
   GST_PAD_DO_EVENT_SIGNALS (pad)--;
@@ -2784,6 +2819,13 @@
   g_return_if_fail (GST_IS_PAD (pad));
   g_return_if_fail (handler_id > 0);
 
+  if (GST_IS_GHOST_PAD (pad)) {
+    pad = gst_ghost_pad_get_target (GST_GHOST_PAD (pad));
+    if (!pad) {
+      return;
+    }
+  }
+  
   GST_OBJECT_LOCK (pad);
   g_signal_handler_disconnect (pad, handler_id);
   GST_PAD_DO_BUFFER_SIGNALS (pad)--;
