Show more specific errors when audio device fails
[mercenary-reloaded.git] / src / libsdl / sdl.c
index d0eeb78..611f046 100644 (file)
@@ -63,7 +63,7 @@ int init_sdl(const char *progname, int width, int height, int sound_samplerate,
        }
        sdl_initialized = 1;
 
-       if (multisampling) {
+       if (multisampling > 1) {
                SDL_GL_SetAttribute(SDL_GL_RED_SIZE, 8);
                SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, 8);
                SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 8);
@@ -132,7 +132,7 @@ int init_sdl(const char *progname, int width, int height, int sound_samplerate,
        /* just in case */
        glDisable(GL_DEPTH_TEST);
        glDisable(GL_CULL_FACE);
-       if (multisampling)
+       if (multisampling > 1)
                glEnable(GL_MULTISAMPLE);
 
        if (rift) {
@@ -162,15 +162,15 @@ int init_sdl(const char *progname, int width, int height, int sound_samplerate,
                rc = -EIO;
                goto error;
        } else if (have.format != want.format) {
-               print_error("Failed to open audio with desired audio format\n");
+               print_error("Failed to open audio with desired audio format (want %d, got %d)\n", want.format, have.format);
                rc = -EIO;
                goto error;
        } else if (have.freq != want.freq) {
-               print_error("Failed to open audio with desired sample rate\n");
+               print_error("Failed to open audio with desired sample rate (want %d, got %d)\n", want.freq, have.freq);
                rc = -EIO;
                goto error;
        } else if (have.channels != want.channels) {
-               print_error("Failed to open audio with desired channels (got %d)\n", have.channels);
+               print_error("Failed to open audio with desired number of channels (want %d, got %d)\n", want.channels, have.channels);
                rc = -EIO;
                goto error;
        } else {