Commit 427472fe2e10955a8432d94e5d76ff6c2f310620

Philipp Wiesemann 2016-07-19T21:02:44

ALSA: Fixed adding wrong status to error message (thanks, romain145!). Fixes Bugzilla #3364.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
diff --git a/src/audio/alsa/SDL_alsa_audio.c b/src/audio/alsa/SDL_alsa_audio.c
index 162ce8c..1a84380 100644
--- a/src/audio/alsa/SDL_alsa_audio.c
+++ b/src/audio/alsa/SDL_alsa_audio.c
@@ -607,7 +607,8 @@ ALSA_OpenDevice(_THIS, void *handle, const char *devname, int iscapture)
     if ( ALSA_set_period_size(this, hwparams, 0) < 0 &&
          ALSA_set_buffer_size(this, hwparams, 0) < 0 ) {
         /* Failed to set desired buffer size, do the best you can... */
-        if ( ALSA_set_period_size(this, hwparams, 1) < 0 ) {
+        status = ALSA_set_period_size(this, hwparams, 1);
+        if (status < 0) {
             ALSA_CloseDevice(this);
             return SDL_SetError("Couldn't set hardware audio parameters: %s", ALSA_snd_strerror(status));
         }