Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
ALSA was testing if (format) was set to zero as an error condition, but
Browse files Browse the repository at this point in the history
 SND_PCM_FORMAT_S8 is zero, so you could never open ALSA for AUDIO_S8 data
 before.
  • Loading branch information
icculus committed Sep 1, 2006
1 parent de266e5 commit 124163b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/audio/alsa/SDL_alsa_audio.c
Expand Up @@ -523,6 +523,7 @@ ALSA_OpenAudio(_THIS, SDL_AudioSpec * spec)
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;
Expand Down Expand Up @@ -555,10 +556,10 @@ ALSA_OpenAudio(_THIS, SDL_AudioSpec * spec)
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);
Expand Down

0 comments on commit 124163b

Please sign in to comment.