Show more specific errors when audio device fails
[mercenary-reloaded.git] / src / libsdl / sdl.c
index 3e5d7bd..611f046 100644 (file)
@@ -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 {