Sounds were cut off due to integer overflow. Fixed.

This commit is contained in:
Ove Kaaven 1999-02-09 14:05:51 +00:00 committed by Alexandre Julliard
parent 43c1efdee5
commit 4d713f97e0
1 changed files with 2 additions and 2 deletions

View File

@ -1799,9 +1799,9 @@ static DWORD DSOUND_MixInBuffer(IDirectSoundBuffer *dsb)
len = DSOUND_FRAGLEN; /* The most we will use */
if (!(dsb->playflags & DSBPLAY_LOOPING)) {
temp = ((primarybuf->wfx.nAvgBytesPerSec * dsb->buflen) /
temp = MulDiv32(primarybuf->wfx.nAvgBytesPerSec, dsb->buflen,
dsb->nAvgBytesPerSec) -
((primarybuf->wfx.nAvgBytesPerSec * dsb->playpos) /
MulDiv32(primarybuf->wfx.nAvgBytesPerSec, dsb->playpos,
dsb->nAvgBytesPerSec);
len = (len > temp) ? temp : len;
}