Module: wine Branch: master Commit: e6f8f136fa557d282f44654be509573cb45a831f URL: http://source.winehq.org/git/wine.git/?a=commit;h=e6f8f136fa557d282f44654be5...
Author: Huw Davies huw@codeweavers.com Date: Wed Mar 1 16:01:00 2017 +0000
dsound: Pass sample count to the normfunction.
Signed-off-by: Huw Davies huw@codeweavers.com Signed-off-by: Andrew Eikum aeikum@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/dsound/dsound_convert.c | 27 ++++++++++++--------------- dlls/dsound/mixer.c | 2 +- 2 files changed, 13 insertions(+), 16 deletions(-)
diff --git a/dlls/dsound/dsound_convert.c b/dlls/dsound/dsound_convert.c index 0c9a34b..6887bae 100644 --- a/dlls/dsound/dsound_convert.c +++ b/dlls/dsound/dsound_convert.c @@ -286,10 +286,10 @@ void mixieee32(float *src, float *dst, unsigned samples) *(dst++) += *(src++); }
-static void norm8(float *src, unsigned char *dst, unsigned len) +static void norm8(float *src, unsigned char *dst, unsigned samples) { - TRACE("%p - %p %d\n", src, dst, len); - while (len--) + TRACE("%p - %p %d\n", src, dst, samples); + while (samples--) { *dst = f_to_8(*src); ++dst; @@ -297,11 +297,10 @@ static void norm8(float *src, unsigned char *dst, unsigned len) } }
-static void norm16(float *src, SHORT *dst, unsigned len) +static void norm16(float *src, SHORT *dst, unsigned samples) { - TRACE("%p - %p %d\n", src, dst, len); - len /= 2; - while (len--) + TRACE("%p - %p %d\n", src, dst, samples); + while (samples--) { *dst = f_to_16(*src); ++dst; @@ -309,11 +308,10 @@ static void norm16(float *src, SHORT *dst, unsigned len) } }
-static void norm24(float *src, BYTE *dst, unsigned len) +static void norm24(float *src, BYTE *dst, unsigned samples) { - TRACE("%p - %p %d\n", src, dst, len); - len /= 3; - while (len--) + TRACE("%p - %p %d\n", src, dst, samples); + while (samples--) { LONG t = f_to_24(*src); dst[0] = (t >> 8) & 0xFF; @@ -324,11 +322,10 @@ static void norm24(float *src, BYTE *dst, unsigned len) } }
-static void norm32(float *src, INT *dst, unsigned len) +static void norm32(float *src, INT *dst, unsigned samples) { - TRACE("%p - %p %d\n", src, dst, len); - len /= 4; - while (len--) + TRACE("%p - %p %d\n", src, dst, samples); + while (samples--) { *dst = f_to_32(*src); ++dst; diff --git a/dlls/dsound/mixer.c b/dlls/dsound/mixer.c index 049a345..1180594 100644 --- a/dlls/dsound/mixer.c +++ b/dlls/dsound/mixer.c @@ -716,7 +716,7 @@ static void DSOUND_PerformMix(DirectSoundDevice *device) /* do the mixing */ DSOUND_MixToPrimary(device, (float*)device->buffer, frames, &all_stopped);
- device->normfunction(device->buffer, buffer, frames * block); + device->normfunction(device->buffer, buffer, frames * device->pwfx->nChannels); }
hr = IAudioRenderClient_ReleaseBuffer(device->render, frames, 0);