summaryrefslogtreecommitdiffstats
path: root/Alc/ALc.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/ALc.c
parent45dc8048193162edbb886921cfcf2955c5232626 (diff)
Store a copy of the device name in the device
Diffstat (limited to 'Alc/ALc.c')
-rw-r--r--Alc/ALc.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/Alc/ALc.c b/Alc/ALc.c
index 588ba903..f3ff1d85 100644
--- a/Alc/ALc.c
+++ b/Alc/ALc.c
@@ -586,6 +586,8 @@ ALCAPI ALCdevice* ALCAPIENTRY alcCaptureOpenDevice(const ALCchar *deviceName, AL
pDevice->Connected = ALC_TRUE;
pDevice->IsCaptureDevice = AL_TRUE;
+ pDevice->szDeviceName = NULL;
+
pDevice->Frequency = frequency;
pDevice->Format = format;
pDevice->BufferSize = SampleSize;
@@ -637,6 +639,8 @@ ALCAPI ALCboolean ALCAPIENTRY alcCaptureCloseDevice(ALCdevice *pDevice)
ProcessContext(NULL);
+ free(pDevice->szDeviceName);
+
ALCdevice_CloseCapture(pDevice);
free(pDevice);
@@ -1378,6 +1382,8 @@ ALCAPI ALCdevice* ALCAPIENTRY alcOpenDevice(const ALCchar *deviceName)
device->Connected = ALC_TRUE;
device->IsCaptureDevice = AL_FALSE;
+ device->szDeviceName = NULL;
+
//Set output format
device->Frequency = GetConfigValueInt(NULL, "frequency", SWMIXER_OUTPUT_RATE);
if(device->Frequency == 0)
@@ -1498,6 +1504,8 @@ ALCAPI ALCboolean ALCAPIENTRY alcCloseDevice(ALCdevice *pDevice)
ReleaseALDatabuffers(pDevice);
}
+ free(pDevice->szDeviceName);
+
//Release device structure
memset(pDevice, 0, sizeof(ALCdevice));
free(pDevice);