Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
Call SDL_Init() before SDL_GetNumAudioDrivers().
Not sure why that was reversed.
  • Loading branch information
icculus committed Jan 10, 2010
1 parent b491cfd commit 0e454c669dfb08661f005b226307053160b044d8
Showing with 6 additions and 6 deletions.
  1. +6 −6 test/testaudioinfo.c
@@ -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) {
@@ -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);

0 comments on commit 0e454c6

Please sign in to comment.