aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaweł Kołodziejski2002-10-01 06:46:50 +0000
committerPaweł Kołodziejski2002-10-01 06:46:50 +0000
commitd6db8560c61fae5597ab108dbf8adf745d1728d4 (patch)
tree2129ff0b8baf8ebd5c8017a2a66d75ca6b78c6ed
parentce182dbaf3c3549b678cf6acb69c9e7d826033c4 (diff)
downloadscummvm-rg350-d6db8560c61fae5597ab108dbf8adf745d1728d4.tar.gz
scummvm-rg350-d6db8560c61fae5597ab108dbf8adf745d1728d4.tar.bz2
scummvm-rg350-d6db8560c61fae5597ab108dbf8adf745d1728d4.zip
fixed ending of non loop sounds
svn-id: r5057
-rw-r--r--scumm/imuse.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/scumm/imuse.cpp b/scumm/imuse.cpp
index 819c8eb89a..1b5f848352 100644
--- a/scumm/imuse.cpp
+++ b/scumm/imuse.cpp
@@ -4866,14 +4866,16 @@ void IMuseDigital::handler() {
}
uint32 new_size = _channel[l]._mixerSize;
+ uint32 mixer_size = new_size;
if (_channel[l]._offset + _channel[l]._mixerSize > _channel[l]._size) {
new_size = _channel[l]._size - _channel[l]._offset;
if(_channel[l]._isLoop == false) {
_channel[l]._toBeRemoved = true;
+ mixer_size = new_size;
}
}
- byte *buf = (byte*)malloc(_channel[l]._mixerSize);
+ byte *buf = (byte*)malloc(mixer_size);
memcpy(buf, _channel[l]._data + _channel[l]._offset, new_size);
if ((new_size != _channel[l]._mixerSize) && (_channel[l]._isLoop == true)) {
memcpy(buf + new_size, _channel[l]._data, _channel[l]._mixerSize - new_size);
@@ -4896,10 +4898,10 @@ void IMuseDigital::handler() {
}
if (new_mixer) {
- _scumm->_mixer->playStream(NULL, _channel[l]._mixerTrack, buf, _channel[l]._mixerSize,
+ _scumm->_mixer->playStream(NULL, _channel[l]._mixerTrack, buf, mixer_size,
_channel[l]._freq, _channel[l]._mixerFlags);
} else {
- _scumm->_mixer->append(_channel[l]._mixerTrack, buf, _channel[l]._mixerSize,
+ _scumm->_mixer->append(_channel[l]._mixerTrack, buf, mixer_size,
_channel[l]._freq, _channel[l]._mixerFlags);
}
_scumm->_system->unlock_mutex(_scumm->_mixer->_mutex);