aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/alsa.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2010-07-04 15:48:47 -0700
committerChris Robinson <[email protected]>2010-07-04 15:48:47 -0700
commitd4b191d27d4ed749d20a6581bcdf567ae5cd00fc (patch)
tree97d268846c979ad6c82fce9d8d0b0476a30051e5 /Alc/alsa.c
parent6b23f2dfa3c4b927df369a318df04fd50c802ab7 (diff)
Avoid retrying the requested ALSA format after it failed
Diffstat (limited to 'Alc/alsa.c')
-rw-r--r--Alc/alsa.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/Alc/alsa.c b/Alc/alsa.c
index 41f105c9..24fcd7b8 100644
--- a/Alc/alsa.c
+++ b/Alc/alsa.c
@@ -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";
}
}