aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/alsa.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2009-09-27 01:12:42 -0700
committerChris Robinson <[email protected]>2009-09-27 01:12:42 -0700
commitc9506d939a10a79d887cb910a7935828765241af (patch)
treed05048ed18cf7e3d81b3ea98245a392455e715ed /Alc/alsa.c
parent21217824b7dbb7a1b22f45078e74c6ad90b9675e (diff)
Make sure ALSA properly loads, and fix the thread stop condition
Diffstat (limited to 'Alc/alsa.c')
-rw-r--r--Alc/alsa.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/Alc/alsa.c b/Alc/alsa.c
index 6ccc4165..3e06ba1e 100644
--- a/Alc/alsa.c
+++ b/Alc/alsa.c
@@ -456,17 +456,17 @@ static ALCboolean alsa_open_playback(ALCdevice *device, const ALCchar *deviceNam
{
if(idx > 0)
sprintf(driver, "hw:%d,%d", allDevNameMap[idx].card, allDevNameMap[idx].dev);
- goto open_alsa;
+ break;
}
}
- return ALC_FALSE;
+ if(idx == numDevNames)
+ return ALC_FALSE;
}
alsa_load();
if(!alsa_handle)
return ALC_FALSE;
-open_alsa:
data = (alsa_data*)calloc(1, sizeof(alsa_data));
i = psnd_pcm_open(&data->pcmHandle, driver, SND_PCM_STREAM_PLAYBACK, SND_PCM_NONBLOCK);
@@ -646,7 +646,7 @@ static void alsa_stop_playback(ALCdevice *device)
{
alsa_data *data = (alsa_data*)device->ExtraData;
- if(!data->thread)
+ if(data->thread)
{
data->killNow = 1;
StopThread(data->thread);