From 4d713f97e0fcd9dac4436529fd4cc000332b2cce Mon Sep 17 00:00:00 2001 From: Ove Kaaven Date: Tue, 9 Feb 1999 14:05:51 +0000 Subject: [PATCH] Sounds were cut off due to integer overflow. Fixed. --- multimedia/dsound.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/multimedia/dsound.c b/multimedia/dsound.c index e8d18ad9de3..50301d4a37a 100644 --- a/multimedia/dsound.c +++ b/multimedia/dsound.c @@ -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; }