Commit 0e0544aa authored by Robert Reif's avatar Robert Reif Committed by Alexandre Julliard

Signed/unsigned fix and code cleanup.

parent 05437748
...@@ -225,7 +225,7 @@ static INT DSOUND_MixerNorm(IDirectSoundBufferImpl *dsb, BYTE *buf, INT len) ...@@ -225,7 +225,7 @@ static INT DSOUND_MixerNorm(IDirectSoundBufferImpl *dsb, BYTE *buf, INT len)
if ((dsb->freq == dsb->dsound->pwfx->nSamplesPerSec) && if ((dsb->freq == dsb->dsound->pwfx->nSamplesPerSec) &&
(dsb->pwfx->wBitsPerSample == dsb->dsound->pwfx->wBitsPerSample) && (dsb->pwfx->wBitsPerSample == dsb->dsound->pwfx->wBitsPerSample) &&
(dsb->pwfx->nChannels == dsb->dsound->pwfx->nChannels)) { (dsb->pwfx->nChannels == dsb->dsound->pwfx->nChannels)) {
DWORD bytesleft = dsb->buflen - dsb->buf_mixpos; INT bytesleft = dsb->buflen - dsb->buf_mixpos;
TRACE("(%p) Best case\n", dsb); TRACE("(%p) Best case\n", dsb);
if (len <= bytesleft ) if (len <= bytesleft )
CopyMemory(obp, ibp, len); CopyMemory(obp, ibp, len);
...@@ -374,18 +374,18 @@ static LPBYTE DSOUND_tmpbuffer(IDirectSoundImpl *dsound, DWORD len) ...@@ -374,18 +374,18 @@ static LPBYTE DSOUND_tmpbuffer(IDirectSoundImpl *dsound, DWORD len)
static DWORD DSOUND_MixInBuffer(IDirectSoundBufferImpl *dsb, DWORD writepos, DWORD fraglen) static DWORD DSOUND_MixInBuffer(IDirectSoundBufferImpl *dsb, DWORD writepos, DWORD fraglen)
{ {
INT i, len, ilen, temp, field, nBlockAlign, todo; INT i, len, ilen, field, nBlockAlign, todo;
BYTE *buf, *ibuf; BYTE *buf, *ibuf;
TRACE("(%p,%ld,%ld)\n",dsb,writepos,fraglen); TRACE("(%p,%ld,%ld)\n",dsb,writepos,fraglen);
len = fraglen; len = fraglen;
if (!(dsb->playflags & DSBPLAY_LOOPING)) { if (!(dsb->playflags & DSBPLAY_LOOPING)) {
temp = MulDiv(dsb->dsound->pwfx->nAvgBytesPerSec, dsb->buflen, INT temp = MulDiv(dsb->dsound->pwfx->nAvgBytesPerSec, dsb->buflen,
dsb->nAvgBytesPerSec) - dsb->nAvgBytesPerSec) -
MulDiv(dsb->dsound->pwfx->nAvgBytesPerSec, dsb->buf_mixpos, MulDiv(dsb->dsound->pwfx->nAvgBytesPerSec, dsb->buf_mixpos,
dsb->nAvgBytesPerSec); dsb->nAvgBytesPerSec);
len = (len > temp) ? temp : len; len = min(len, temp);
} }
nBlockAlign = dsb->dsound->pwfx->nBlockAlign; nBlockAlign = dsb->dsound->pwfx->nBlockAlign;
len = len / nBlockAlign * nBlockAlign; /* data alignment */ len = len / nBlockAlign * nBlockAlign; /* data alignment */
......
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