- Proxy the get_caps function slightly differently. This is potentially dangerous...
authorWim Taymans <wim.taymans@gmail.com>
Thu, 23 Jan 2003 19:49:18 +0000 (19:49 +0000)
committerWim Taymans <wim.taymans@gmail.com>
Thu, 23 Jan 2003 19:49:18 +0000 (19:49 +0000)
Original commit message from CVS:
- Proxy the get_caps function slightly differently. This is potentially
dangerous as it works quite differently. My tests seem to work though and
it fixes the play-multi-file-segfault in the player.

gst/gstqueue.c
plugins/elements/gstqueue.c

index 54cdd5c..040ecbb 100644 (file)
@@ -194,11 +194,14 @@ gst_queue_getcaps (GstPad *pad, GstCaps *caps)
   GstPad *otherpad;
 
   if (pad == queue->srcpad) 
-    otherpad = queue->sinkpad;
+    otherpad = GST_PAD_PEER (queue->sinkpad);
   else
-    otherpad = queue->srcpad;
+    otherpad = GST_PAD_PEER (queue->srcpad);
+  
+  if (otherpad)
+    return gst_pad_get_caps (otherpad);
 
-  return gst_pad_get_allowed_caps (otherpad);
+  return NULL;
 }
 
 static void
index 54cdd5c..040ecbb 100644 (file)
@@ -194,11 +194,14 @@ gst_queue_getcaps (GstPad *pad, GstCaps *caps)
   GstPad *otherpad;
 
   if (pad == queue->srcpad) 
-    otherpad = queue->sinkpad;
+    otherpad = GST_PAD_PEER (queue->sinkpad);
   else
-    otherpad = queue->srcpad;
+    otherpad = GST_PAD_PEER (queue->srcpad);
+  
+  if (otherpad)
+    return gst_pad_get_caps (otherpad);
 
-  return gst_pad_get_allowed_caps (otherpad);
+  return NULL;
 }
 
 static void