Index: gstdecodebin2.c
===================================================================
RCS file: /cvs/gstreamer/gst-plugins-base/gst/playback/gstdecodebin2.c,v
retrieving revision 1.20
diff -u -p -u -p -r1.20 gstdecodebin2.c
--- gstdecodebin2.c	28 Jun 2007 09:46:11 -0000	1.20
+++ gstdecodebin2.c	10 Sep 2007 09:05:26 -0000
@@ -206,6 +206,8 @@ struct _GstDecodeGroup
 
   GList *endpads;               /* List of GstDecodePad of source pads to be exposed */
   GList *ghosts;                /* List of GstGhostPad for the endpads */
+  
+  GList *reqpads;               /* List of RequestPads */
 };
 
 #define GROUP_MUTEX_LOCK(group) G_STMT_START {				\
@@ -1140,7 +1142,7 @@ type_found (GstElement * typefind, guint
 
   GST_DEBUG_OBJECT (decode_bin, "typefind found caps %" GST_PTR_FORMAT, caps);
 
-  pad = gst_element_get_pad (typefind, "src");
+  pad = gst_element_get_static_pad (typefind, "src");
 
   analyze_new_pad (decode_bin, typefind, pad, caps, NULL);
 
@@ -1156,7 +1158,7 @@ pad_added_group_cb (GstElement * element
   GstCaps *caps;
   gboolean expose = FALSE;
 
-  GST_LOG_OBJECT (pad, "pad added, group:%p", group);
+  GST_DEBUG_OBJECT (pad, "pad added, group:%p", group);
 
   caps = gst_pad_get_caps (pad);
   analyze_new_pad (group->dbin, element, pad, caps, group);
@@ -1455,6 +1457,7 @@ gst_decode_group_new (GstDecodeBin * dbi
   group->blocked = FALSE;
   group->complete = FALSE;
   group->endpads = NULL;
+  group->reqpads = NULL;
 
   if (mq) {
     /* we first configure the mulitqueue to buffer an unlimited number of
@@ -1542,7 +1545,7 @@ gst_decode_group_control_demuxer_pad (Gs
 
   srcpad = NULL;
 
-  if (!(sinkpad = gst_element_get_pad (group->multiqueue, "sink%d"))) {
+  if (!(sinkpad = gst_element_get_request_pad (group->multiqueue, "sink%d"))) {
     GST_ERROR ("Couldn't get sinkpad from multiqueue");
     return NULL;
   }
@@ -1551,6 +1554,8 @@ gst_decode_group_control_demuxer_pad (Gs
     GST_ERROR ("Couldn't link demuxer and multiqueue");
     goto beach;
   }
+  
+  group->reqpads = g_list_append (group->reqpads, sinkpad);
 
   sinkname = gst_pad_get_name (sinkpad);
   nb = sinkname + 4;
@@ -1957,6 +1962,13 @@ gst_decode_group_free (GstDecodeGroup * 
   g_list_free (group->endpads);
   group->endpads = NULL;
 
+  /* release request pads */
+  for (tmp = group->reqpads; tmp; tmp = g_list_next (tmp)) {
+    gst_element_release_request_pad (group->multiqueue, GST_PAD (tmp->data));
+  }
+  g_list_free (group->reqpads);
+  group->reqpads = NULL;
+
   /* disconnect signal handlers on multiqueue */
   if (group->multiqueue) {
     if (group->underrunsig)
