Correction to earlier assertion patch to allow for buf_mixpos ==

buflen in non-looping case, fixes looping of one-off mixed samples
introduced by previous patch.
This commit is contained in:
Alex Villacís Lasso 2005-08-03 19:13:58 +00:00 committed by Alexandre Julliard
parent b1722b7ad7
commit 5577cc739d
1 changed files with 3 additions and 1 deletions

View File

@ -490,8 +490,10 @@ static DWORD DSOUND_MixInBuffer(IDirectSoundBufferImpl *dsb, DWORD writepos, DWO
dsb->buf_mixpos %= dsb->buflen;
if (dsb->leadin && (dsb->startpos <= dsb->buf_mixpos))
dsb->leadin = FALSE; /* HACK: see above */
} else if (dsb->buf_mixpos > dsb->buflen) {
ERR("Mixpos (%lu) past buflen (%lu), capping...\n", dsb->buf_mixpos, dsb->buflen);
dsb->buf_mixpos = dsb->buflen;
}
else dsb->buf_mixpos = 0; /* %= dsb->buflen; */
}
return len;