Commit 59f531f6 authored by Ryan C. Gordon's avatar Ryan C. Gordon

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.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%402056
parent 176414e7
...@@ -523,6 +523,7 @@ ALSA_OpenAudio(_THIS, SDL_AudioSpec * spec) ...@@ -523,6 +523,7 @@ ALSA_OpenAudio(_THIS, SDL_AudioSpec * spec)
status = -1; status = -1;
for (test_format = SDL_FirstAudioFormat(spec->format); for (test_format = SDL_FirstAudioFormat(spec->format);
test_format && (status < 0);) { test_format && (status < 0);) {
status = 0; /* if we can't support a format, it'll become -1. */
switch (test_format) { switch (test_format) {
case AUDIO_U8: case AUDIO_U8:
format = SND_PCM_FORMAT_U8; format = SND_PCM_FORMAT_U8;
...@@ -555,10 +556,10 @@ ALSA_OpenAudio(_THIS, SDL_AudioSpec * spec) ...@@ -555,10 +556,10 @@ ALSA_OpenAudio(_THIS, SDL_AudioSpec * spec)
format = SND_PCM_FORMAT_FLOAT_BE; format = SND_PCM_FORMAT_FLOAT_BE;
break; break;
default: default:
format = 0; status = -1;
break; break;
} }
if (format != 0) { if (status >= 0) {
status = status =
SDL_NAME(snd_pcm_hw_params_set_format) (pcm_handle, SDL_NAME(snd_pcm_hw_params_set_format) (pcm_handle,
hwparams, format); hwparams, format);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment