diff options
author | Chris Robinson <[email protected]> | 2010-08-01 16:20:28 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2010-08-01 16:20:28 -0700 |
commit | fe6e73ede9c4137992e2945bf4db0d7ab897208b (patch) | |
tree | f41d7d6bf96e7dc3cffc15d51821fbe5e24bafff /Alc/winmm.c | |
parent | 8dab4c418cd95a9ceb7ecf3211c1cf97201b7b1e (diff) |
Be a bit more verbose when a device fails to open
Diffstat (limited to 'Alc/winmm.c')
-rw-r--r-- | Alc/winmm.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/Alc/winmm.c b/Alc/winmm.c index 70398a17..61ff87b7 100644 --- a/Alc/winmm.c +++ b/Alc/winmm.c @@ -190,6 +190,7 @@ static ALCboolean WinMMOpenCapture(ALCdevice *pDevice, const ALCchar *deviceName ALint lDeviceID = 0; ALbyte *BufferData; ALint lBufferSize; + MMRESULT res; ALuint i; if(!CaptureDeviceList) @@ -240,16 +241,19 @@ static ALCboolean WinMMOpenCapture(ALCdevice *pDevice, const ALCchar *deviceName wfexCaptureFormat.nBlockAlign; wfexCaptureFormat.cbSize = 0; - if (waveInOpen(&pData->hWaveInHandle, lDeviceID, &wfexCaptureFormat, (DWORD_PTR)&WaveInProc, (DWORD_PTR)pDevice, CALLBACK_FUNCTION) != MMSYSERR_NOERROR) + if((res=waveInOpen(&pData->hWaveInHandle, lDeviceID, &wfexCaptureFormat, (DWORD_PTR)&WaveInProc, (DWORD_PTR)pDevice, CALLBACK_FUNCTION)) != MMSYSERR_NOERROR) + { + AL_PRINT("waveInOpen failed: %u\n", res); goto failure; + } pData->hWaveInHdrEvent = CreateEvent(NULL, AL_TRUE, AL_FALSE, "WaveInAllHeadersReturned"); - if (pData->hWaveInHdrEvent == NULL) - goto failure; - pData->hWaveInThreadEvent = CreateEvent(NULL, AL_TRUE, AL_FALSE, "WaveInThreadDestroyed"); - if (pData->hWaveInThreadEvent == NULL) + if(pData->hWaveInHdrEvent == NULL || pData->hWaveInThreadEvent == NULL) + { + AL_PRINT("CreateEvent failed: %lu\n", GetLastError()); goto failure; + } // Allocate circular memory buffer for the captured audio ulCapturedDataSize = pDevice->UpdateSize*pDevice->NumUpdates; |