aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/ALc.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2010-02-10 16:34:43 -0800
committerChris Robinson <[email protected]>2010-02-10 16:34:43 -0800
commitd17c4a098cc12b279769f50be8d0f8860fac3204 (patch)
treed3a6f23d358497cd730b036860611d50eb509258 /Alc/ALc.c
parent96303893bc981ba9b52799d4cd67f2becab9e127 (diff)
Avoid probing for devices on lib initialization
Diffstat (limited to 'Alc/ALc.c')
-rw-r--r--Alc/ALc.c23
1 files changed, 17 insertions, 6 deletions
diff --git a/Alc/ALc.c b/Alc/ALc.c
index 2e2501b3..2f998c70 100644
--- a/Alc/ALc.c
+++ b/Alc/ALc.c
@@ -322,14 +322,8 @@ static void alc_init(void)
}
for(i = 0;BackendList[i].Init;i++)
- {
BackendList[i].Init(&BackendList[i].Funcs);
- BackendList[i].Probe(DEVICE_PROBE);
- BackendList[i].Probe(ALL_DEVICE_PROBE);
- BackendList[i].Probe(CAPTURE_DEVICE_PROBE);
- }
-
DuplicateStereo = GetConfigValueBool(NULL, "stereodup", 0);
str = GetConfigValue(NULL, "excludefx", "");
@@ -685,6 +679,9 @@ ALCAPI ALCdevice* ALCAPIENTRY alcCaptureOpenDevice(const ALCchar *deviceName, AL
if(deviceName && !deviceName[0])
deviceName = NULL;
+ if(!alcCaptureDeviceList)
+ ProbeCaptureDeviceList();
+
pDevice = malloc(sizeof(ALCdevice));
if (pDevice)
{
@@ -901,6 +898,9 @@ ALCAPI const ALCchar* ALCAPIENTRY alcGetString(ALCdevice *pDevice,ALCenum param)
/* Default devices are always first in the list */
case ALC_DEFAULT_DEVICE_SPECIFIER:
+ if(!alcDeviceList)
+ ProbeDeviceList();
+
free(alcDefaultDeviceSpecifier);
alcDefaultDeviceSpecifier = strdup(alcDeviceList ? alcDeviceList : "");
if(!alcDefaultDeviceSpecifier)
@@ -909,6 +909,9 @@ ALCAPI const ALCchar* ALCAPIENTRY alcGetString(ALCdevice *pDevice,ALCenum param)
break;
case ALC_DEFAULT_ALL_DEVICES_SPECIFIER:
+ if(!alcAllDeviceList)
+ ProbeAllDeviceList();
+
free(alcDefaultAllDeviceSpecifier);
alcDefaultAllDeviceSpecifier = strdup(alcAllDeviceList ?
alcAllDeviceList : "");
@@ -918,6 +921,9 @@ ALCAPI const ALCchar* ALCAPIENTRY alcGetString(ALCdevice *pDevice,ALCenum param)
break;
case ALC_CAPTURE_DEFAULT_DEVICE_SPECIFIER:
+ if(!alcCaptureDeviceList)
+ ProbeCaptureDeviceList();
+
free(alcCaptureDefaultDeviceSpecifier);
alcCaptureDefaultDeviceSpecifier = strdup(alcCaptureDeviceList ?
alcCaptureDeviceList : "");
@@ -1678,6 +1684,11 @@ ALCAPI ALCdevice* ALCAPIENTRY alcOpenDevice(const ALCchar *deviceName)
if(deviceName && !deviceName[0])
deviceName = NULL;
+ if(!alcDeviceList)
+ ProbeDeviceList();
+ if(!alcAllDeviceList)
+ ProbeAllDeviceList();
+
device = malloc(sizeof(ALCdevice));
if (device)
{