diff options
author | Chris Robinson <[email protected]> | 2010-07-04 15:48:47 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2010-07-04 15:48:47 -0700 |
commit | d4b191d27d4ed749d20a6581bcdf567ae5cd00fc (patch) | |
tree | 97d268846c979ad6c82fce9d8d0b0476a30051e5 /Alc/alsa.c | |
parent | 6b23f2dfa3c4b927df369a318df04fd50c802ab7 (diff) |
Avoid retrying the requested ALSA format after it failed
Diffstat (limited to 'Alc/alsa.c')
-rw-r--r-- | Alc/alsa.c | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -593,7 +593,8 @@ static ALCboolean alsa_reset_playback(ALCdevice *device) case 7: device->Format = AL_FORMAT_61CHN32; break; case 8: device->Format = AL_FORMAT_71CHN32; break; } - if((i=psnd_pcm_hw_params_set_format(data->pcmHandle, p, SND_PCM_FORMAT_FLOAT)) < 0) + if(format == SND_PCM_FORMAT_FLOAT || + (i=psnd_pcm_hw_params_set_format(data->pcmHandle, p, SND_PCM_FORMAT_FLOAT)) < 0) { switch(aluChannelsFromFormat(device->Format)) { @@ -604,7 +605,8 @@ static ALCboolean alsa_reset_playback(ALCdevice *device) case 7: device->Format = AL_FORMAT_61CHN16; break; case 8: device->Format = AL_FORMAT_71CHN16; break; } - if((i=psnd_pcm_hw_params_set_format(data->pcmHandle, p, SND_PCM_FORMAT_S16)) < 0) + if(format == SND_PCM_FORMAT_S16 || + (i=psnd_pcm_hw_params_set_format(data->pcmHandle, p, SND_PCM_FORMAT_S16)) < 0) { switch(aluChannelsFromFormat(device->Format)) { @@ -615,7 +617,8 @@ static ALCboolean alsa_reset_playback(ALCdevice *device) case 7: device->Format = AL_FORMAT_61CHN8; break; case 8: device->Format = AL_FORMAT_71CHN8; break; } - if((i=psnd_pcm_hw_params_set_format(data->pcmHandle, p, SND_PCM_FORMAT_U8)) < 0) + if(format == SND_PCM_FORMAT_U8 || + (i=psnd_pcm_hw_params_set_format(data->pcmHandle, p, SND_PCM_FORMAT_U8)) < 0) err = "set format"; } } |