aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/dsound.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2009-08-27 02:53:09 -0700
committerChris Robinson <[email protected]>2009-08-27 02:53:09 -0700
commit6bb14e45cee9d8d7da37675cc6933146f7a95155 (patch)
tree238b8354671a87e00867af28424a4bf23b813e1c /Alc/dsound.c
parent45dc8048193162edbb886921cfcf2955c5232626 (diff)
Store a copy of the device name in the device
Diffstat (limited to 'Alc/dsound.c')
-rw-r--r--Alc/dsound.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/Alc/dsound.c b/Alc/dsound.c
index 644407b8..8f5d3b11 100644
--- a/Alc/dsound.c
+++ b/Alc/dsound.c
@@ -151,6 +151,7 @@ static ALuint DSoundProc(ALvoid *ptr)
static ALCboolean DSoundOpenPlayback(ALCdevice *device, const ALCchar *deviceName)
{
DSoundData *pData = NULL;
+ const char *devName;
LPGUID guid = NULL;
HRESULT hr;
@@ -164,7 +165,7 @@ static ALCboolean DSoundOpenPlayback(ALCdevice *device, const ALCchar *deviceNam
{
if(strcmp(deviceName, DeviceList[i].name) == 0)
{
- device->szDeviceName = DeviceList[i].name;
+ devName = DeviceList[i].name;
if(i > 0)
guid = &DeviceList[i].guid;
break;
@@ -174,7 +175,7 @@ static ALCboolean DSoundOpenPlayback(ALCdevice *device, const ALCchar *deviceNam
return ALC_FALSE;
}
else
- device->szDeviceName = DeviceList[0].name;
+ devName = DeviceList[0].name;
//Initialise requested device
@@ -197,6 +198,7 @@ static ALCboolean DSoundOpenPlayback(ALCdevice *device, const ALCchar *deviceNam
return ALC_FALSE;
}
+ device->szDeviceName = strdup(devName);
device->ExtraData = pData;
return ALC_TRUE;
}