ALSA was testing if (format) was set to zero as an error condition, but
authorRyan C. Gordon <icculus@icculus.org>
Fri, 01 Sep 2006 17:49:27 +0000
changeset 2009f2058fb367e4
parent 2008 4ad1e863d100
child 2010 39897da56f63
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.
src/audio/alsa/SDL_alsa_audio.c
     1.1 --- a/src/audio/alsa/SDL_alsa_audio.c	Fri Sep 01 07:50:36 2006 +0000
     1.2 +++ b/src/audio/alsa/SDL_alsa_audio.c	Fri Sep 01 17:49:27 2006 +0000
     1.3 @@ -523,6 +523,7 @@
     1.4      status = -1;
     1.5      for (test_format = SDL_FirstAudioFormat(spec->format);
     1.6           test_format && (status < 0);) {
     1.7 +        status = 0;  /* if we can't support a format, it'll become -1. */
     1.8          switch (test_format) {
     1.9          case AUDIO_U8:
    1.10              format = SND_PCM_FORMAT_U8;
    1.11 @@ -555,10 +556,10 @@
    1.12              format = SND_PCM_FORMAT_FLOAT_BE;
    1.13              break;
    1.14          default:
    1.15 -            format = 0;
    1.16 +            status = -1;
    1.17              break;
    1.18          }
    1.19 -        if (format != 0) {
    1.20 +        if (status >= 0) {
    1.21              status =
    1.22                  SDL_NAME(snd_pcm_hw_params_set_format) (pcm_handle,
    1.23                                                          hwparams, format);