Print the list of audio drivers so you can try each one
This commit is contained in:
parent
8042e18f9a
commit
0b8d0b3c80
1 changed files with 15 additions and 0 deletions
|
@ -78,6 +78,8 @@ poked(int sig)
|
|||
int
|
||||
main(int argc, char *argv[])
|
||||
{
|
||||
int i;
|
||||
|
||||
/* Load the SDL library */
|
||||
if (SDL_Init(SDL_INIT_AUDIO) < 0) {
|
||||
fprintf(stderr, "Couldn't initialize SDL: %s\n", SDL_GetError());
|
||||
|
@ -106,6 +108,17 @@ main(int argc, char *argv[])
|
|||
signal(SIGTERM, poked);
|
||||
#endif /* HAVE_SIGNAL_H */
|
||||
|
||||
/* Show the list of available drivers */
|
||||
printf("Available audio drivers: ");
|
||||
for (i = 0; i < SDL_GetNumAudioDrivers(); ++i) {
|
||||
if (i == 0) {
|
||||
printf("%s", SDL_GetAudioDriver(i));
|
||||
} else {
|
||||
printf(", %s", SDL_GetAudioDriver(i));
|
||||
}
|
||||
}
|
||||
printf("\n");
|
||||
|
||||
/* Initialize fillerup() variables */
|
||||
if (SDL_OpenAudio(&wave.spec, NULL) < 0) {
|
||||
fprintf(stderr, "Couldn't open audio: %s\n", SDL_GetError());
|
||||
|
@ -126,3 +139,5 @@ main(int argc, char *argv[])
|
|||
SDL_Quit();
|
||||
return (0);
|
||||
}
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue