aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/winmm.c
diff options
context:
space:
mode:
Diffstat (limited to 'Alc/winmm.c')
-rw-r--r--Alc/winmm.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Alc/winmm.c b/Alc/winmm.c
index 3b226f29..1f62f5a1 100644
--- a/Alc/winmm.c
+++ b/Alc/winmm.c
@@ -198,7 +198,6 @@ static ALCboolean WinMMOpenCapture(ALCdevice *pDevice, const ALCchar *deviceName
if(i == NumCaptureDevices)
return ALC_FALSE;
}
- pDevice->szDeviceName = CaptureDeviceList[lDeviceID];
pData = calloc(1, sizeof(*pData));
if(!pData)
@@ -268,6 +267,7 @@ static ALCboolean WinMMOpenCapture(ALCdevice *pDevice, const ALCchar *deviceName
if (pData->hWaveInThread == NULL)
goto failure;
+ pDevice->szDeviceName = strdup(CaptureDeviceList[lDeviceID]);
return ALC_TRUE;
failure:
@@ -291,6 +291,7 @@ failure:
CloseHandle(pData->hWaveInThreadEvent);
free(pData);
+ pDevice->ExtraData = NULL;
return ALC_FALSE;
}