aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/dsound.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2010-11-25 14:35:32 -0800
committerChris Robinson <[email protected]>2010-11-25 14:35:32 -0800
commitfbd6439bd2e9d4bd73a045ebd6407180836b59df (patch)
tree42d28e4f47d0d07e871735a3c1483ddfb8b9a4ec /Alc/dsound.c
parentf72c735f9eaf6f438d8344199e54f48cd6a9312e (diff)
Make the first enumerated DirectSound device use the default, and fix the name
Diffstat (limited to 'Alc/dsound.c')
-rw-r--r--Alc/dsound.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/Alc/dsound.c b/Alc/dsound.c
index 2a7f8de0..ce7dd80d 100644
--- a/Alc/dsound.c
+++ b/Alc/dsound.c
@@ -68,7 +68,7 @@ typedef struct {
GUID guid;
} DevMap;
-static const ALCchar dsDevice[] = "DirectSound Software";
+static const ALCchar dsDevice[] = "DirectSound Default";
static DevMap *DeviceList;
static ALuint NumDevices;
@@ -118,6 +118,18 @@ static BOOL CALLBACK DSoundEnumDevices(LPGUID guid, LPCSTR desc, LPCSTR drvname,
(void)data;
(void)drvname;
+ if(NumDevices == 0)
+ {
+ temp = realloc(DeviceList, sizeof(DevMap) * (NumDevices+1));
+ if(temp)
+ {
+ DeviceList = temp;
+ DeviceList[NumDevices].name = strdup(dsDevice);
+ DeviceList[NumDevices].guid = GUID_NULL;
+ NumDevices++;
+ }
+ }
+
if(!guid)
return TRUE;
@@ -271,7 +283,8 @@ static ALCboolean DSoundOpenPlayback(ALCdevice *device, const ALCchar *deviceNam
{
if(strcmp(deviceName, DeviceList[i].name) == 0)
{
- guid = &DeviceList[i].guid;
+ if(i > 0)
+ guid = &DeviceList[i].guid;
break;
}
}