aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/backends/winmm.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2011-08-24 14:44:15 -0700
committerChris Robinson <[email protected]>2011-08-24 14:44:15 -0700
commit7e2155d937e66dc7c4a1445bf12e64684eebb5a0 (patch)
tree4af5b1cc0f824b60e30be1d1d9cfed9216d8ac7a /Alc/backends/winmm.c
parentc696d4dbb23461066ed741a36a83da10b6ad17f5 (diff)
Return an ALC error enum from the OpenCapture backend method
Diffstat (limited to 'Alc/backends/winmm.c')
-rw-r--r--Alc/backends/winmm.c16
1 files changed, 5 insertions, 11 deletions
diff --git a/Alc/backends/winmm.c b/Alc/backends/winmm.c
index cd61a156..2a286259 100644
--- a/Alc/backends/winmm.c
+++ b/Alc/backends/winmm.c
@@ -483,7 +483,7 @@ static void WinMMStopPlayback(ALCdevice *device)
}
-static ALCboolean WinMMOpenCapture(ALCdevice *pDevice, const ALCchar *deviceName)
+static ALCenum WinMMOpenCapture(ALCdevice *pDevice, const ALCchar *deviceName)
{
WAVEFORMATEX wfexCaptureFormat;
DWORD ulCapturedDataSize;
@@ -522,22 +522,16 @@ static ALCboolean WinMMOpenCapture(ALCdevice *pDevice, const ALCchar *deviceName
}
}
if(i == NumCaptureDevices)
- return ALC_FALSE;
+ return ALC_INVALID_VALUE;
pData = calloc(1, sizeof(*pData));
if(!pData)
- {
- alcSetError(pDevice, ALC_OUT_OF_MEMORY);
- return ALC_FALSE;
- }
+ return ALC_OUT_OF_MEMORY;
pDevice->ExtraData = pData;
if((pDevice->FmtChans != DevFmtMono && pDevice->FmtChans != DevFmtStereo) ||
(pDevice->FmtType != DevFmtUByte && pDevice->FmtType != DevFmtShort))
- {
- alcSetError(pDevice, ALC_INVALID_ENUM);
goto failure;
- }
memset(&wfexCaptureFormat, 0, sizeof(WAVEFORMATEX));
wfexCaptureFormat.wFormatTag = WAVE_FORMAT_PCM;
@@ -605,7 +599,7 @@ static ALCboolean WinMMOpenCapture(ALCdevice *pDevice, const ALCchar *deviceName
goto failure;
pDevice->szDeviceName = strdup(CaptureDeviceList[lDeviceID]);
- return ALC_TRUE;
+ return ALC_NO_ERROR;
failure:
if(pData->hWaveThread)
@@ -632,7 +626,7 @@ failure:
free(pData);
pDevice->ExtraData = NULL;
- return ALC_FALSE;
+ return ALC_INVALID_VALUE;
}
static void WinMMCloseCapture(ALCdevice *pDevice)