changeset 2009:f2058fb367e4

ALSA was testing if (format) was set to zero as an error condition, but SND_PCM_FORMAT_S8 is zero, so you could never open ALSA for AUDIO_S8 data before.
author Ryan C. Gordon <icculus@icculus.org>
date Fri, 01 Sep 2006 17:49:27 +0000
parents 4ad1e863d100
children 39897da56f63
files src/audio/alsa/SDL_alsa_audio.c
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/audio/alsa/SDL_alsa_audio.c	Fri Sep 01 07:50:36 2006 +0000
+++ b/src/audio/alsa/SDL_alsa_audio.c	Fri Sep 01 17:49:27 2006 +0000
@@ -523,6 +523,7 @@
     status = -1;
     for (test_format = SDL_FirstAudioFormat(spec->format);
          test_format && (status < 0);) {
+        status = 0;  /* if we can't support a format, it'll become -1. */
         switch (test_format) {
         case AUDIO_U8:
             format = SND_PCM_FORMAT_U8;
@@ -555,10 +556,10 @@
             format = SND_PCM_FORMAT_FLOAT_BE;
             break;
         default:
-            format = 0;
+            status = -1;
             break;
         }
-        if (format != 0) {
+        if (status >= 0) {
             status =
                 SDL_NAME(snd_pcm_hw_params_set_format) (pcm_handle,
                                                         hwparams, format);