aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/dsound.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2007-12-14 08:51:45 -0800
committerChris Robinson <[email protected]>2007-12-14 08:51:45 -0800
commit5f4659534abfc3a27cdae32606f699f189275ec8 (patch)
tree93a9e9978b28d1548b880c7169fb53ba161f0a31 /Alc/dsound.c
parent5da394ab617ab7d11e5b11610bb8dd83033e3920 (diff)
Store a persistant name string with the device struct
Diffstat (limited to 'Alc/dsound.c')
-rw-r--r--Alc/dsound.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/Alc/dsound.c b/Alc/dsound.c
index c65637c8..a2b036a1 100644
--- a/Alc/dsound.c
+++ b/Alc/dsound.c
@@ -114,11 +114,16 @@ static ALCboolean DSoundOpenPlayback(ALCdevice *device, const ALCchar *deviceNam
for(i = 0;DeviceList[i];i++)
{
if(strcmp(deviceName, DeviceList[i]) == 0)
- break;
+ {
+ device->szDeviceName = DeviceList[i];
+ break;
+ }
}
if(!DeviceList[i])
return ALC_FALSE;
}
+ else
+ device->szDeviceName = DeviceList[0];
//Platform specific
memset(&OutputType, 0, sizeof(WAVEFORMATEX));
@@ -188,11 +193,6 @@ static ALCboolean DSoundOpenPlayback(ALCdevice *device, const ALCchar *deviceNam
pData->ulDSTimerID = timeSetEvent(25, 0, (LPTIMECALLBACK)DirectSoundProc, (DWORD)device, (UINT)TIME_CALLBACK_FUNCTION|TIME_PERIODIC);
device->MaxNoOfSources = 256;
- if(deviceName)
- strcpy(device->szDeviceName, deviceName);
- else
- strcpy(device->szDeviceName, DeviceList[0]);
-
device->ExtraData = pData;
return ALC_TRUE;
}