Commit e6f8f136 authored by Huw Davies's avatar Huw Davies Committed by Alexandre Julliard

dsound: Pass sample count to the normfunction.

parent 134b684f
...@@ -286,10 +286,10 @@ void mixieee32(float *src, float *dst, unsigned samples) ...@@ -286,10 +286,10 @@ void mixieee32(float *src, float *dst, unsigned samples)
*(dst++) += *(src++); *(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); TRACE("%p - %p %d\n", src, dst, samples);
while (len--) while (samples--)
{ {
*dst = f_to_8(*src); *dst = f_to_8(*src);
++dst; ++dst;
...@@ -297,11 +297,10 @@ static void norm8(float *src, unsigned char *dst, unsigned len) ...@@ -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); TRACE("%p - %p %d\n", src, dst, samples);
len /= 2; while (samples--)
while (len--)
{ {
*dst = f_to_16(*src); *dst = f_to_16(*src);
++dst; ++dst;
...@@ -309,11 +308,10 @@ static void norm16(float *src, SHORT *dst, unsigned len) ...@@ -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); TRACE("%p - %p %d\n", src, dst, samples);
len /= 3; while (samples--)
while (len--)
{ {
LONG t = f_to_24(*src); LONG t = f_to_24(*src);
dst[0] = (t >> 8) & 0xFF; dst[0] = (t >> 8) & 0xFF;
...@@ -324,11 +322,10 @@ static void norm24(float *src, BYTE *dst, unsigned len) ...@@ -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); TRACE("%p - %p %d\n", src, dst, samples);
len /= 4; while (samples--)
while (len--)
{ {
*dst = f_to_32(*src); *dst = f_to_32(*src);
++dst; ++dst;
......
...@@ -716,7 +716,7 @@ static void DSOUND_PerformMix(DirectSoundDevice *device) ...@@ -716,7 +716,7 @@ static void DSOUND_PerformMix(DirectSoundDevice *device)
/* do the mixing */ /* do the mixing */
DSOUND_MixToPrimary(device, (float*)device->buffer, frames, &all_stopped); 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); hr = IAudioRenderClient_ReleaseBuffer(device->render, frames, 0);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment