From e944bbb954974ebd0d02fdc0d5332556b4dfd65b Mon Sep 17 00:00:00 2001 From: Jerry Jenkins Date: Tue, 17 Sep 2002 01:29:26 +0000 Subject: [PATCH] Modified volume_effect8 for taking unsigned data as signed data, and wodPlayer_WriteMaxFrags because of wrong data length which lead to strange noise and volume control working incorrectly. --- dlls/winmm/winearts/audio.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/dlls/winmm/winearts/audio.c b/dlls/winmm/winearts/audio.c index ca822fc65fb..832c56f4838 100644 --- a/dlls/winmm/winearts/audio.c +++ b/dlls/winmm/winearts/audio.c @@ -202,8 +202,8 @@ void volume_effect16(void *bufin, void* bufout, int length, int left, void volume_effect8(void *bufin, void* bufout, int length, int left, int right, int nChannels) { - char *d_out = (char *)bufout; - char *d_in = (char *)bufin; + BYTE *d_out = (BYTE *)bufout; + BYTE *d_in = (BYTE *)bufin; int i, v; /* @@ -214,11 +214,11 @@ void volume_effect8(void *bufin, void* bufout, int length, int left, for(i = 0; i < length; i+=(nChannels)) { - v = (char) ((*(d_in++) * left) / 100); + v = (BYTE) ((*(d_in++) * left) / 100); *(d_out++) = (v>255) ? 255 : ((v<0) ? 0 : v); if(nChannels == 2) { - v = (char) ((*(d_in++) * right) / 100); + v = (BYTE) ((*(d_in++) * right) / 100); *(d_out++) = (v>255) ? 255 : ((v<0) ? 0 : v); } } @@ -645,7 +645,7 @@ static int wodPlayer_WriteMaxFrags(WINE_WAVEOUT* wwo, DWORD* bytes) { /* apply volume to the buffer we are about to send */ volume_effect8(wwo->lpPlayPtr->lpData + wwo->dwPartialOffset, - wwo->sound_buffer, toWrite>>1, wwo->volume_left, + wwo->sound_buffer, toWrite, wwo->volume_left, wwo->volume_right, wwo->format.wf.nChannels); } else {