5 #define MAX_OUT_DRIVERS 5
7 static struct out_driver out_drivers[MAX_OUT_DRIVERS];
8 struct out_driver *out_current;
9 static int driver_count;
11 #define REGISTER_DRIVER(d) { \
12 extern void out_register_##d(struct out_driver *drv); \
13 out_register_##d(&out_drivers[driver_count++]); \
20 if (driver_count == 0) {
25 REGISTER_DRIVER(alsa);
31 REGISTER_DRIVER(pulse);
34 REGISTER_DRIVER(libretro);
36 REGISTER_DRIVER(none);
40 for (i = 0; i < driver_count; i++)
41 if (out_drivers[i].init() == 0)
44 if (i < 0 || i >= driver_count) {
45 printf("the impossible happened\n");
49 out_current = &out_drivers[i];
50 printf("selected sound output driver: %s\n", out_current->name);