# HG changeset patch # User Ryan C. Gordon # Date 1263150597 0 # Node ID 5ea5e4e6103f1757e9d547d7e53233a6f46ea7c7 # Parent 1e31a24c41a6e3173fa6f017c91a447e33796b35 Call SDL_Init() before SDL_GetNumAudioDrivers(). Not sure why that was reversed. diff -r 1e31a24c41a6 -r 5ea5e4e6103f test/testaudioinfo.c --- a/test/testaudioinfo.c Sun Jan 10 18:25:04 2010 +0000 +++ b/test/testaudioinfo.c Sun Jan 10 19:09:57 2010 +0000 @@ -25,6 +25,12 @@ 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 @@ 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);