Explaining odd hacks with a comment is usually a good idea :-)

svn-id: r12875
This commit is contained in:
Max Horn 2004-02-14 12:01:07 +00:00
parent 99551bd746
commit 7447ea8fb3

View File

@ -296,8 +296,13 @@ void IMuseDigital::startSound(int soundId, const char *soundName, int soundType,
assert(channels == 1 || channels == 2);
assert(0 < freq && freq <= 65535);
freq /= 25;
freq *= 25;
// Round the frequency to a multiple of 25. This is done to
// ensure we don't run into data under-/overflows (this is a
// design limitation of the current IMuseDigital code, which
// pushes data 'blindly' into the mixer, instead of providing
// a pull based interface, i.e. a custom AudioInputStream
// subclass).
freq -= (fraq % 25);
_track[l].iteration = _track[l].pullSize = freq * channels;