make request pads work
authorAndy Wingo <wingo@pobox.com>
Tue, 16 Jul 2002 14:36:53 +0000 (14:36 +0000)
committerAndy Wingo <wingo@pobox.com>
Tue, 16 Jul 2002 14:36:53 +0000 (14:36 +0000)
Original commit message from CVS:
make request pads work

ext/alsa/gstalsa.c

index efe396a..a212353 100644 (file)
@@ -357,18 +357,18 @@ gst_alsa_request_new_pad (GstElement *element, GstPadTemplate *templ, const gcha
             }
             l = l->next;
         }
+        newname = g_strdup (name);
     } else {
         l = this->pads;
         channel = 0;
         while (l) {
-            if (GST_ALSA_PAD(l)->channel > channel)
-                channel = GST_ALSA_PAD(l)->channel;
+            if (GST_ALSA_PAD(l)->channel >= channel)
+                channel = GST_ALSA_PAD(l)->channel + 1;
             l = l->next;
         }
+        newname = g_strdup_printf (templ->name_template, channel);
     }
     
-    newname = g_strdup (name);
-    
     pad = g_new0(GstAlsaPad, 1);
     pad->channel = channel;
     pad->pad = gst_pad_new_from_template (templ, newname);