Mercurial > sdl-ios-xcode
comparison src/audio/alsa/SDL_alsa_audio.c @ 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 | 0ca6ba107642 |
children | 39897da56f63 |
comparison
equal
deleted
inserted
replaced
2008:4ad1e863d100 | 2009:f2058fb367e4 |
---|---|
521 | 521 |
522 /* Try for a closest match on audio format */ | 522 /* Try for a closest match on audio format */ |
523 status = -1; | 523 status = -1; |
524 for (test_format = SDL_FirstAudioFormat(spec->format); | 524 for (test_format = SDL_FirstAudioFormat(spec->format); |
525 test_format && (status < 0);) { | 525 test_format && (status < 0);) { |
526 status = 0; /* if we can't support a format, it'll become -1. */ | |
526 switch (test_format) { | 527 switch (test_format) { |
527 case AUDIO_U8: | 528 case AUDIO_U8: |
528 format = SND_PCM_FORMAT_U8; | 529 format = SND_PCM_FORMAT_U8; |
529 break; | 530 break; |
530 case AUDIO_S8: | 531 case AUDIO_S8: |
553 break; | 554 break; |
554 case AUDIO_F32MSB: | 555 case AUDIO_F32MSB: |
555 format = SND_PCM_FORMAT_FLOAT_BE; | 556 format = SND_PCM_FORMAT_FLOAT_BE; |
556 break; | 557 break; |
557 default: | 558 default: |
558 format = 0; | 559 status = -1; |
559 break; | 560 break; |
560 } | 561 } |
561 if (format != 0) { | 562 if (status >= 0) { |
562 status = | 563 status = |
563 SDL_NAME(snd_pcm_hw_params_set_format) (pcm_handle, | 564 SDL_NAME(snd_pcm_hw_params_set_format) (pcm_handle, |
564 hwparams, format); | 565 hwparams, format); |
565 } | 566 } |
566 if (status < 0) { | 567 if (status < 0) { |