aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2012-02-20 20:45:22 -0800
committerChris Robinson <[email protected]>2012-02-20 20:45:22 -0800
commite2ccc6f98e63dc2ba74e2c989be3fc899602848d (patch)
treec8ba48b3f6276ff37537d0240e4630852b8443df
parentd24ada7ab7605a7e990fe299fc7d56a08e870c84 (diff)
Always use "OpenAL Soft" for the short device enumeration list
-rw-r--r--Alc/ALc.c37
-rw-r--r--Alc/backends/alsa.c4
-rw-r--r--Alc/backends/coreaudio.c3
-rw-r--r--Alc/backends/dsound.c4
-rw-r--r--Alc/backends/mmdevapi.c4
-rw-r--r--Alc/backends/null.c3
-rw-r--r--Alc/backends/opensl.c3
-rw-r--r--Alc/backends/oss.c10
-rw-r--r--Alc/backends/portaudio.c3
-rw-r--r--Alc/backends/pulseaudio.c23
-rw-r--r--Alc/backends/sndio.c3
-rw-r--r--Alc/backends/solaris.c3
-rw-r--r--Alc/backends/wave.c3
-rw-r--r--Alc/backends/winmm.c6
-rw-r--r--OpenAL32/Include/alMain.h2
15 files changed, 7 insertions, 104 deletions
diff --git a/Alc/ALc.c b/Alc/ALc.c
index f4d20844..da5aa257 100644
--- a/Alc/ALc.c
+++ b/Alc/ALc.c
@@ -327,14 +327,12 @@ static const ALCchar alcErrOutOfMemory[] = "Out of Memory";
/* Device lists. Sizes only include the first ending null character, not the
* second */
-static ALCchar *alcDeviceList;
-static size_t alcDeviceListSize;
+static const ALCchar alcDefaultName[] = "OpenAL Soft\0";
static ALCchar *alcAllDeviceList;
static size_t alcAllDeviceListSize;
static ALCchar *alcCaptureDeviceList;
static size_t alcCaptureDeviceListSize;
/* Default is always the first in the list */
-static ALCchar *alcDefaultDeviceSpecifier;
static ALCchar *alcDefaultAllDeviceSpecifier;
static ALCchar *alcCaptureDefaultDeviceSpecifier;
@@ -758,8 +756,6 @@ static void ProbeList(ALCchar **list, size_t *listsize, enum DevProbe type)
UnlockLists();
}
-static void ProbeDeviceList(void)
-{ ProbeList(&alcDeviceList, &alcDeviceListSize, DEVICE_PROBE); }
static void ProbeAllDeviceList(void)
{ ProbeList(&alcAllDeviceList, &alcAllDeviceListSize, ALL_DEVICE_PROBE); }
static void ProbeCaptureDeviceList(void)
@@ -791,7 +787,6 @@ static void AppendList(const ALCchar *name, ALCchar **List, size_t *ListSize)
void Append##type##List(const ALCchar *name) \
{ AppendList(name, &alc##type##List, &alc##type##ListSize); }
-DECL_APPEND_LIST_FUNC(Device)
DECL_APPEND_LIST_FUNC(AllDevice)
DECL_APPEND_LIST_FUNC(CaptureDevice)
@@ -1626,7 +1621,7 @@ ALC_API ALCdevice* ALC_APIENTRY alcCaptureOpenDevice(const ALCchar *deviceName,
return NULL;
}
- if(deviceName && (!deviceName[0] || strcasecmp(deviceName, "openal soft") == 0 || strcasecmp(deviceName, "openal-soft") == 0))
+ if(deviceName && (!deviceName[0] || strcasecmp(deviceName, alcDefaultName) == 0 || strcasecmp(deviceName, "openal-soft") == 0))
deviceName = NULL;
device = calloc(1, sizeof(ALCdevice));
@@ -1835,16 +1830,13 @@ ALC_API const ALCchar* ALC_APIENTRY alcGetString(ALCdevice *pDevice,ALCenum para
break;
case ALC_DEVICE_SPECIFIER:
- if(VerifyDevice(pDevice))
+ if(!VerifyDevice(pDevice))
+ value = alcDefaultName;
+ else
{
value = pDevice->szDeviceName;
ALCdevice_DecRef(pDevice);
}
- else
- {
- ProbeDeviceList();
- value = alcDeviceList;
- }
break;
case ALC_ALL_DEVICES_SPECIFIER:
@@ -1867,18 +1859,7 @@ ALC_API const ALCchar* ALC_APIENTRY alcGetString(ALCdevice *pDevice,ALCenum para
/* Default devices are always first in the list */
case ALC_DEFAULT_DEVICE_SPECIFIER:
- if(!alcDeviceList)
- ProbeDeviceList();
-
- pDevice = VerifyDevice(pDevice);
-
- free(alcDefaultDeviceSpecifier);
- alcDefaultDeviceSpecifier = strdup(alcDeviceList ? alcDeviceList : "");
- if(!alcDefaultDeviceSpecifier)
- alcSetError(pDevice, ALC_OUT_OF_MEMORY);
-
- value = alcDefaultDeviceSpecifier;
- if(pDevice) ALCdevice_DecRef(pDevice);
+ value = alcDefaultName;
break;
case ALC_DEFAULT_ALL_DEVICES_SPECIFIER:
@@ -2419,7 +2400,7 @@ ALC_API ALCdevice* ALC_APIENTRY alcOpenDevice(const ALCchar *deviceName)
return NULL;
}
- if(deviceName && (!deviceName[0] || strcasecmp(deviceName, "openal soft") == 0 || strcasecmp(deviceName, "openal-soft") == 0))
+ if(deviceName && (!deviceName[0] || strcasecmp(deviceName, alcDefaultName) == 0 || strcasecmp(deviceName, "openal-soft") == 0))
deviceName = NULL;
device = calloc(1, sizeof(ALCdevice)+sizeof(ALeffectslot));
@@ -2784,15 +2765,11 @@ static void ReleaseALC(void)
{
ALCdevice *dev;
- free(alcDeviceList); alcDeviceList = NULL;
- alcDeviceListSize = 0;
free(alcAllDeviceList); alcAllDeviceList = NULL;
alcAllDeviceListSize = 0;
free(alcCaptureDeviceList); alcCaptureDeviceList = NULL;
alcCaptureDeviceListSize = 0;
- free(alcDefaultDeviceSpecifier);
- alcDefaultDeviceSpecifier = NULL;
free(alcDefaultAllDeviceSpecifier);
alcDefaultAllDeviceSpecifier = NULL;
free(alcCaptureDefaultDeviceSpecifier);
diff --git a/Alc/backends/alsa.c b/Alc/backends/alsa.c
index e86d4fc5..193152fb 100644
--- a/Alc/backends/alsa.c
+++ b/Alc/backends/alsa.c
@@ -1117,10 +1117,6 @@ void alc_alsa_probe(enum DevProbe type)
switch(type)
{
- case DEVICE_PROBE:
- AppendDeviceList(alsaDevice);
- break;
-
case ALL_DEVICE_PROBE:
for(i = 0;i < numDevNames;++i)
free(allDevNameMap[i].device);
diff --git a/Alc/backends/coreaudio.c b/Alc/backends/coreaudio.c
index 0a1c1e76..15c08ef6 100644
--- a/Alc/backends/coreaudio.c
+++ b/Alc/backends/coreaudio.c
@@ -668,9 +668,6 @@ void alc_ca_probe(enum DevProbe type)
{
switch(type)
{
- case DEVICE_PROBE:
- AppendDeviceList(ca_device);
- break;
case ALL_DEVICE_PROBE:
AppendAllDeviceList(ca_device);
break;
diff --git a/Alc/backends/dsound.c b/Alc/backends/dsound.c
index 51fd8d9b..e2375137 100644
--- a/Alc/backends/dsound.c
+++ b/Alc/backends/dsound.c
@@ -929,10 +929,6 @@ void alcDSoundProbe(enum DevProbe type)
switch(type)
{
- case DEVICE_PROBE:
- AppendDeviceList(dsDevice);
- break;
-
case ALL_DEVICE_PROBE:
for(i = 0;i < NumPlaybackDevices;++i)
free(PlaybackDeviceList[i].name);
diff --git a/Alc/backends/mmdevapi.c b/Alc/backends/mmdevapi.c
index c4679f85..59068406 100644
--- a/Alc/backends/mmdevapi.c
+++ b/Alc/backends/mmdevapi.c
@@ -987,10 +987,6 @@ void alcMMDevApiProbe(enum DevProbe type)
switch(type)
{
- case DEVICE_PROBE:
- AppendDeviceList(mmDevice);
- break;
-
case ALL_DEVICE_PROBE:
req.FinishedEvt = CreateEvent(NULL, FALSE, FALSE, NULL);
if(req.FinishedEvt == NULL)
diff --git a/Alc/backends/null.c b/Alc/backends/null.c
index 7b501b58..8e581f15 100644
--- a/Alc/backends/null.c
+++ b/Alc/backends/null.c
@@ -152,9 +152,6 @@ void alc_null_probe(enum DevProbe type)
{
switch(type)
{
- case DEVICE_PROBE:
- AppendDeviceList(nullDevice);
- break;
case ALL_DEVICE_PROBE:
AppendAllDeviceList(nullDevice);
break;
diff --git a/Alc/backends/opensl.c b/Alc/backends/opensl.c
index 405f66af..58acc828 100644
--- a/Alc/backends/opensl.c
+++ b/Alc/backends/opensl.c
@@ -410,9 +410,6 @@ void alc_opensl_probe(enum DevProbe type)
{
switch(type)
{
- case DEVICE_PROBE:
- AppendDeviceList(opensl_device);
- break;
case ALL_DEVICE_PROBE:
AppendAllDeviceList(opensl_device);
break;
diff --git a/Alc/backends/oss.c b/Alc/backends/oss.c
index 0e4a5393..21c62d13 100644
--- a/Alc/backends/oss.c
+++ b/Alc/backends/oss.c
@@ -500,16 +500,6 @@ void alc_oss_probe(enum DevProbe type)
{
switch(type)
{
- case DEVICE_PROBE:
- {
-#ifdef HAVE_STAT
- struct stat buf;
- if(stat(GetConfigValue("oss", "device", "/dev/dsp"), &buf) == 0)
-#endif
- AppendDeviceList(oss_device);
- }
- break;
-
case ALL_DEVICE_PROBE:
{
#ifdef HAVE_STAT
diff --git a/Alc/backends/portaudio.c b/Alc/backends/portaudio.c
index bd3bb4d8..2ac668b8 100644
--- a/Alc/backends/portaudio.c
+++ b/Alc/backends/portaudio.c
@@ -438,9 +438,6 @@ void alc_pa_probe(enum DevProbe type)
{
switch(type)
{
- case DEVICE_PROBE:
- AppendDeviceList(pa_device);
- break;
case ALL_DEVICE_PROBE:
AppendAllDeviceList(pa_device);
break;
diff --git a/Alc/backends/pulseaudio.c b/Alc/backends/pulseaudio.c
index 6100d59f..1e4086e1 100644
--- a/Alc/backends/pulseaudio.c
+++ b/Alc/backends/pulseaudio.c
@@ -1365,33 +1365,10 @@ void alc_pulse_deinit(void) //{{{
void alc_pulse_probe(enum DevProbe type) //{{{
{
- pa_threaded_mainloop *loop;
ALuint i;
switch(type)
{
- case DEVICE_PROBE:
- if((loop=pa_threaded_mainloop_new()) &&
- pa_threaded_mainloop_start(loop) >= 0)
- {
- pa_context *context;
-
- pa_threaded_mainloop_lock(loop);
- context = connect_context(loop, AL_FALSE);
- if(context)
- {
- AppendDeviceList(pulse_device);
-
- pa_context_disconnect(context);
- pa_context_unref(context);
- }
- pa_threaded_mainloop_unlock(loop);
- pa_threaded_mainloop_stop(loop);
- }
- if(loop)
- pa_threaded_mainloop_free(loop);
- break;
-
case ALL_DEVICE_PROBE:
for(i = 0;i < numDevNames;++i)
{
diff --git a/Alc/backends/sndio.c b/Alc/backends/sndio.c
index af4ba387..4866a0a5 100644
--- a/Alc/backends/sndio.c
+++ b/Alc/backends/sndio.c
@@ -357,9 +357,6 @@ void alc_sndio_probe(enum DevProbe type)
{
switch(type)
{
- case DEVICE_PROBE:
- AppendDeviceList(sndio_device);
- break;
case ALL_DEVICE_PROBE:
AppendAllDeviceList(sndio_device);
break;
diff --git a/Alc/backends/solaris.c b/Alc/backends/solaris.c
index 445ec9ef..02a6c9a5 100644
--- a/Alc/backends/solaris.c
+++ b/Alc/backends/solaris.c
@@ -268,9 +268,6 @@ void alc_solaris_probe(enum DevProbe type)
switch(type)
{
- case DEVICE_PROBE:
- AppendDeviceList(solaris_device);
- break;
case ALL_DEVICE_PROBE:
AppendAllDeviceList(solaris_device);
break;
diff --git a/Alc/backends/wave.c b/Alc/backends/wave.c
index f5c14174..5ef363d3 100644
--- a/Alc/backends/wave.c
+++ b/Alc/backends/wave.c
@@ -342,9 +342,6 @@ void alc_wave_probe(enum DevProbe type)
switch(type)
{
- case DEVICE_PROBE:
- AppendDeviceList(waveDevice);
- break;
case ALL_DEVICE_PROBE:
AppendAllDeviceList(waveDevice);
break;
diff --git a/Alc/backends/winmm.c b/Alc/backends/winmm.c
index 6ca5f31d..994c073c 100644
--- a/Alc/backends/winmm.c
+++ b/Alc/backends/winmm.c
@@ -752,12 +752,6 @@ void alcWinMMProbe(enum DevProbe type)
switch(type)
{
- case DEVICE_PROBE:
- ProbePlaybackDevices();
- if(NumPlaybackDevices > 0)
- AppendDeviceList(woDefault);
- break;
-
case ALL_DEVICE_PROBE:
ProbePlaybackDevices();
if(NumPlaybackDevices > 0)
diff --git a/OpenAL32/Include/alMain.h b/OpenAL32/Include/alMain.h
index 490721be..ddb93c84 100644
--- a/OpenAL32/Include/alMain.h
+++ b/OpenAL32/Include/alMain.h
@@ -439,7 +439,6 @@ static __inline ALuint fastf2u(ALfloat f)
enum DevProbe {
- DEVICE_PROBE,
ALL_DEVICE_PROBE,
CAPTURE_DEVICE_PROBE
};
@@ -697,7 +696,6 @@ ALCcontext *GetContextRef(void);
void ALCcontext_IncRef(ALCcontext *context);
void ALCcontext_DecRef(ALCcontext *context);
-void AppendDeviceList(const ALCchar *name);
void AppendAllDeviceList(const ALCchar *name);
void AppendCaptureDeviceList(const ALCchar *name);