svn-id: r13659
This commit is contained in:
Paweł Kołodziejski 2004-04-28 05:39:53 +00:00
parent d6e78803db
commit 319ae4deed
3 changed files with 8 additions and 6 deletions

View File

@ -165,10 +165,13 @@ void IMuseDigital::callback() {
int bits = _sound->getBits(_track[l]->soundHandle);
int channels = _sound->getChannels(_track[l]->soundHandle);
int32 mixer_size = _track[l]->stream->getFreeSpace() - 4;
if ((_track[l]->iteration / 2) > mixer_size)
int32 freeSpace = _track[l]->stream->getFreeSpace() - 4;
int32 bufferMin = (_track[l]->iteration * 3) / 4;
if (bufferMin > freeSpace)
continue;
int32 mixer_size = freeSpace;
if ((bits == 12) || (bits == 16)) {
if (channels == 1)
mixer_size &= ~1;

View File

@ -85,7 +85,6 @@ void ImuseDigiSndMgr::prepareSound(byte *ptr, int slot) {
int len;
int32 offset = READ_LE_UINT16(ptr + 20);
/* int16 version = */ READ_LE_UINT16(ptr + 22);
int16 code = READ_LE_UINT16(ptr + 24);
_sounds[slot].region = (_region *)malloc(sizeof(_region) * 70);

View File

@ -43,7 +43,7 @@ bool IMuseDigital::allocSlot(int priority) {
}
if (!found_free) {
warning("IMuseDigital::startSound(): All slots are full");
debug(5, "IMuseDigital::startSound(): All slots are full");
for (l = 0; l < MAX_DIGITAL_TRACKS; l++) {
if (_track[l]->used && _track[l]->handle.isActive() &&
(lower_priority > _track[l]->priority) && (!_track[l]->stream2))
@ -65,9 +65,9 @@ bool IMuseDigital::allocSlot(int priority) {
_track[track_id]->soundHandle = NULL;
_track[track_id]->used = false;
assert(!_track[track_id]->handle.isActive());
warning("IMuseDigital::startSound(): Removed sound %d from track %d", _track[track_id]->soundId, track_id);
debug(5, "IMuseDigital::startSound(): Removed sound %d from track %d", _track[track_id]->soundId, track_id);
} else {
warning("IMuseDigital::startSound(): Priority sound too low");
debug(5, "IMuseDigital::startSound(): Priority sound too low");
return false;
}
}