diff options
author | Chris Robinson <[email protected]> | 2011-09-14 02:01:35 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2011-09-14 02:01:35 -0700 |
commit | 97024151e49d97ed3ae9d73a9426de0f1a9ebb0f (patch) | |
tree | 841c413a23725d55a6b872b531bcc38689ba96cd /Alc/backends/winmm.c | |
parent | 62dfea43c699cb18a7538980794106d3ac0edca6 (diff) |
Return an error from the CaptureSamples method instead of setting it
Diffstat (limited to 'Alc/backends/winmm.c')
-rw-r--r-- | Alc/backends/winmm.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Alc/backends/winmm.c b/Alc/backends/winmm.c index 0a186662..1a9f099b 100644 --- a/Alc/backends/winmm.c +++ b/Alc/backends/winmm.c @@ -683,14 +683,14 @@ static ALCuint WinMMAvailableSamples(ALCdevice *pDevice) return RingBufferSize(pData->pRing); } -static void WinMMCaptureSamples(ALCdevice *pDevice, ALCvoid *pBuffer, ALCuint lSamples) +static ALCenum WinMMCaptureSamples(ALCdevice *pDevice, ALCvoid *pBuffer, ALCuint lSamples) { WinMMData *pData = (WinMMData*)pDevice->ExtraData; - if(WinMMAvailableSamples(pDevice) >= lSamples) - ReadRingBuffer(pData->pRing, pBuffer, lSamples); - else - alcSetError(pDevice, ALC_INVALID_VALUE); + if(WinMMAvailableSamples(pDevice) < lSamples) + return ALC_INVALID_VALUE; + ReadRingBuffer(pData->pRing, pBuffer, lSamples); + return ALC_NO_ERROR; } |