fatal_alsa_error(_("cannot enumerate sound cards"), err);
if (number < 0)
break;
+#if defined(SND_LIB_VER) && SND_LIB_VER(1, 2, 5) <= SND_LIB_VERSION
+ sprintf(buf, "sysdefault:%d", number);
+#else
sprintf(buf, "hw:%d", number);
+#endif
err = snd_ctl_open(&ctl, buf, 0);
if (err < 0)
continue;
};
int option;
int card_index;
- static char name_buf[16];
+ static char name_buf[24];
while ((option = getopt_long(argc, argv, short_options,
long_options, NULL)) != -1) {
fprintf(stderr, _("invalid card index: %s\n"), optarg);
goto fail;
}
+#if defined(SND_LIB_VER) && SND_LIB_VER(1, 2, 5) <= SND_LIB_VERSION
+ sprintf(name_buf, "sysdefault:%d", card_index);
+#else
sprintf(name_buf, "hw:%d", card_index);
+#endif
selem_regopt.device = name_buf;
break;
case 'D':
int i;
i = snd_card_get_index(optarg);
if (i >= 0 && i < 32)
+#if defined(SND_LIB_VER) && SND_LIB_VER(1, 2, 5) <= SND_LIB_VERSION
+ sprintf(card, "sysdefault:%i", i);
+#else
sprintf(card, "hw:%i", i);
+#endif
else {
fprintf(stderr, "Invalid card number.\n");
morehelp++;