diff options
author | Chris Robinson <[email protected]> | 2010-05-24 21:51:30 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2010-05-24 21:51:30 -0700 |
commit | 37190b2cafdec52a23034194a3e63d8d33bdc544 (patch) | |
tree | 99dada718dcb76d94223b62392f0181b5a3314ba /Alc/winmm.c | |
parent | c6b948323ebc8632e0b763f090cdcd19255d0ac2 (diff) |
Add a function to get the frame size from a format
Diffstat (limited to 'Alc/winmm.c')
-rw-r--r-- | Alc/winmm.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/Alc/winmm.c b/Alc/winmm.c index 8f27519e..d20a0fb8 100644 --- a/Alc/winmm.c +++ b/Alc/winmm.c @@ -402,8 +402,7 @@ static void WinMMCaptureSamples(ALCdevice *pDevice, ALCvoid *pBuffer, ALCuint lS ALuint ulBytes, ulBytesToCopy; ALuint ulCapturedSamples; ALuint ulReadOffset; - ALuint frameSize = aluBytesFromFormat(pDevice->Format) * - aluChannelsFromFormat(pDevice->Format); + ALuint frameSize = aluFrameSizeFromFormat(pDevice->Format); // Check that we have the requested numbers of Samples ulCapturedSamples = (pData->ulWriteCapturedDataPos - @@ -444,8 +443,7 @@ static ALCuint WinMMAvailableSamples(ALCdevice *pDevice) { WinMMData *pData = (WinMMData*)pDevice->ExtraData; ALCuint lCapturedBytes = (pData->ulWriteCapturedDataPos - pData->ulReadCapturedDataPos); - return lCapturedBytes / (aluBytesFromFormat(pDevice->Format) * - aluChannelsFromFormat(pDevice->Format)); + return lCapturedBytes / aluFrameSizeFromFormat(pDevice->Format); } |