Commit 896072b2 authored by Ryan C. Gordon's avatar Ryan C. Gordon

Call SDL_Init() before SDL_GetNumAudioDrivers().

Not sure why that was reversed.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%404386
parent 9d95b504
...@@ -25,6 +25,12 @@ print_devices(int iscapture) ...@@ -25,6 +25,12 @@ print_devices(int iscapture)
int int
main(int argc, char **argv) main(int argc, char **argv)
{ {
/* Load the SDL library */
if (SDL_Init(SDL_INIT_AUDIO) < 0) {
fprintf(stderr, "Couldn't initialize SDL: %s\n", SDL_GetError());
return (1);
}
/* Print available audio drivers */ /* Print available audio drivers */
int n = SDL_GetNumAudioDrivers(); int n = SDL_GetNumAudioDrivers();
if (n == 0) { if (n == 0) {
...@@ -38,12 +44,6 @@ main(int argc, char **argv) ...@@ -38,12 +44,6 @@ main(int argc, char **argv)
printf("\n"); printf("\n");
} }
/* Load the SDL library */
if (SDL_Init(SDL_INIT_AUDIO) < 0) {
fprintf(stderr, "Couldn't initialize SDL: %s\n", SDL_GetError());
return (1);
}
printf("Using audio driver: %s\n\n", SDL_GetCurrentAudioDriver()); printf("Using audio driver: %s\n\n", SDL_GetCurrentAudioDriver());
print_devices(0); print_devices(0);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment