]> git.alsa-project.org Git - alsa-lib.git/commitdiff
Accept string type card
authorTakashi Iwai <tiwai@suse.de>
Tue, 22 Feb 2005 20:21:23 +0000 (20:21 +0000)
committerTakashi Iwai <tiwai@suse.de>
Tue, 22 Feb 2005 20:21:23 +0000 (20:21 +0000)
Accept string type card entry to be compatible with others.

src/pcm/pcm_softvol.c

index 9a1b6be7fd3f1469eecb9dd6f6bafbb1646717ce..15570a57533292e6c81de7cbe980ec531b5dec58 100644 (file)
@@ -686,12 +686,21 @@ static int parse_control_id(snd_config_t *conf, snd_ctl_elem_id_t *ctl_id, int *
                if (strcmp(id, "comment") == 0)
                        continue;
                if (strcmp(id, "card") == 0) {
+                       const char *str;
                        long v;
                        if ((err = snd_config_get_integer(n, &v)) < 0) {
-                               SNDERR("field %s is not an integer", id);
-                               goto _err;
-                       }
-                       *cardp = v;
+                               if ((err = snd_config_get_string(n, &str)) < 0) {
+                                       SNDERR("Invalid field %s", id);
+                                       goto _err;
+                               }
+                               *cardp = snd_card_get_index(str);
+                               if (*cardp < 0) {
+                                       SNDERR("Cannot get index for %s", str);
+                                       err = *cardp;
+                                       goto _err;
+                               }
+                       } else
+                               *cardp = v;
                        continue;
                }
                if (strcmp(id, "iface") == 0 || strcmp(id, "interface") == 0) {