LordHavoc is the one for noticing this.

By using snd_mixahead.value, the start time was being cast to a float, which eventually resulted in inaccuracies with longer uptimes.
This extra cast will ensure starttime is independant of uptime (it's an int).

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@2182 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2006-04-09 01:59:07 +00:00
parent 68afaaacd0
commit b22df9d2d0

View file

@ -1334,7 +1334,7 @@ void S_Update_(soundcardinfo_t *sc)
}
// mix ahead of current position
endtime = soundtime + _snd_mixahead.value * sc->sn.speed;
endtime = soundtime + (int)(_snd_mixahead.value * sc->sn.speed);
// samps = shm->samples >> (shm->numchannels-1);
samps = sc->sn.samples / sc->sn.numchannels;
if (endtime - soundtime > samps)