From a9a689c59286384ec1c7fca29dc9f25a12112971 Mon Sep 17 00:00:00 2001 From: Davin McCall Date: Tue, 1 Nov 2005 10:18:55 +0000 Subject: [PATCH] PhaseCancel subtracts secondary buffer from primary buffer, not the other way around. --- dlls/dsound/mixer.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/dlls/dsound/mixer.c b/dlls/dsound/mixer.c index b5b0a9b31fd..edf88e3a8eb 100644 --- a/dlls/dsound/mixer.c +++ b/dlls/dsound/mixer.c @@ -536,8 +536,8 @@ static void DSOUND_PhaseCancel(IDirectSoundBufferImpl *dsb, DWORD writepos, DWOR for (i = 0; i < todo; i++) { /* 8-bit WAV is unsigned */ - field = (*ibuf++ - 128); - field -= (*obuf - 128); + field = (*obuf - 128); + field -= (*ibuf++ - 128); if (field > 127) field = 127; else if (field < -128) field = -128; *obuf++ = field + 128; @@ -549,8 +549,8 @@ static void DSOUND_PhaseCancel(IDirectSoundBufferImpl *dsb, DWORD writepos, DWOR for (i = 0; i < todo; i++) { /* 8-bit WAV is unsigned */ - field = (*ibuf++ - 128); - field -= (*obuf - 128); + field = (*obuf - 128); + field -= (*ibuf++ - 128); if (field > 127) field = 127; else if (field < -128) field = -128; *obuf++ = field + 128; @@ -569,8 +569,8 @@ static void DSOUND_PhaseCancel(IDirectSoundBufferImpl *dsb, DWORD writepos, DWOR for (i = 0; i < todo; i++) { /* 16-bit WAV is signed */ - field = *ibufs++; - field -= *obufs; + field = *obufs; + field -= *ibufs++; if (field > 32767) field = 32767; else if (field < -32768) field = -32768; *obufs++ = field; @@ -582,8 +582,8 @@ static void DSOUND_PhaseCancel(IDirectSoundBufferImpl *dsb, DWORD writepos, DWOR for (i = 0; i < todo; i++) { /* 16-bit WAV is signed */ - field = *ibufs++; - field -= *obufs; + field = *obufs; + field -= *ibufs++; if (field > 32767) field = 32767; else if (field < -32768) field = -32768; *obufs++ = field;