aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/backends/dsound.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2012-02-20 22:03:08 -0800
committerChris Robinson <[email protected]>2012-02-20 22:03:08 -0800
commit14912229b1e433842077ac0fd483f0bebb9aafbd (patch)
tree8234f7148d6e128df17ad02973b81480977d0e73 /Alc/backends/dsound.c
parent2b64df05e63eb21dc2ecfa3aa32fd54e5413a13e (diff)
Avoid default names for winmm and dsound
Diffstat (limited to 'Alc/backends/dsound.c')
-rw-r--r--Alc/backends/dsound.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/Alc/backends/dsound.c b/Alc/backends/dsound.c
index e2375137..851dd9e2 100644
--- a/Alc/backends/dsound.c
+++ b/Alc/backends/dsound.c
@@ -86,7 +86,6 @@ typedef struct {
GUID guid;
} DevMap;
-static const ALCchar dsDevice[] = "DirectSound Default";
static DevMap *PlaybackDeviceList;
static ALuint NumPlaybackDevices;
static DevMap *CaptureDeviceList;
@@ -312,18 +311,21 @@ static ALCenum DSoundOpenPlayback(ALCdevice *device, const ALCchar *deviceName)
LPGUID guid = NULL;
HRESULT hr;
- if(!deviceName)
- deviceName = dsDevice;
- else if(strcmp(deviceName, dsDevice) != 0)
+ if(!PlaybackDeviceList)
{
- ALuint i;
+ hr = DirectSoundEnumerateA(DSoundEnumPlaybackDevices, NULL);
+ if(FAILED(hr))
+ ERR("Error enumerating DirectSound devices (%#x)!\n", (unsigned int)hr);
+ }
- if(!PlaybackDeviceList)
- {
- hr = DirectSoundEnumerateA(DSoundEnumPlaybackDevices, NULL);
- if(FAILED(hr))
- ERR("Error enumerating DirectSound devices (%#x)!\n", (unsigned int)hr);
- }
+ if(!deviceName && NumPlaybackDevices > 0)
+ {
+ deviceName = PlaybackDeviceList[0].name;
+ guid = &PlaybackDeviceList[0].guid;
+ }
+ else
+ {
+ ALuint i;
for(i = 0;i < NumPlaybackDevices;i++)
{