Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Call SDL_Init() before SDL_GetNumAudioDrivers().
Browse files Browse the repository at this point in the history
Not sure why that was reversed.
  • Loading branch information
icculus committed Jan 10, 2010
1 parent b491cfd commit 0e454c6
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions test/testaudioinfo.c
Expand Up @@ -25,6 +25,12 @@ print_devices(int iscapture)
int
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 */
int n = SDL_GetNumAudioDrivers();
if (n == 0) {
Expand All @@ -38,12 +44,6 @@ main(int argc, char **argv)
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());

print_devices(0);
Expand Down

0 comments on commit 0e454c6

Please sign in to comment.