aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/alsa.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2009-09-21 02:53:33 -0700
committerChris Robinson <[email protected]>2009-09-21 02:53:33 -0700
commite11b59a80f542e08bc877d1447f885fb0f5cc439 (patch)
tree9295577e517bf06d82eccf29700ac3b20bdfdb1c /Alc/alsa.c
parent0ae02e8ad4f77287e4641ab9491c94efac2d402b (diff)
Return imediately if trying to set an unknown format
Diffstat (limited to 'Alc/alsa.c')
-rw-r--r--Alc/alsa.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/Alc/alsa.c b/Alc/alsa.c
index 8a28ce0f..1fa90039 100644
--- a/Alc/alsa.c
+++ b/Alc/alsa.c
@@ -425,8 +425,8 @@ static ALCboolean alsa_reset_playback(ALCdevice *device)
data->format = SND_PCM_FORMAT_FLOAT;
break;
default:
- data->format = SND_PCM_FORMAT_UNKNOWN;
- AL_PRINT("Unknown format?! %x\n", device->Format);
+ AL_PRINT("Unknown format: 0x%x\n", device->Format);
+ return ALC_FALSE;
}
allowmmap = GetConfigValueBool("alsa", "mmap", 1);
@@ -624,8 +624,10 @@ open_alsa:
data->format = SND_PCM_FORMAT_FLOAT;
break;
default:
- data->format = SND_PCM_FORMAT_UNKNOWN;
- AL_PRINT("Unknown format?! %x\n", pDevice->Format);
+ AL_PRINT("Unknown format: 0x%x\n", pDevice->Format);
+ psnd_pcm_close(data->pcmHandle);
+ free(data);
+ return ALC_FALSE;
}
err = NULL;