diff options
author | Paweł Kołodziejski | 2003-12-24 18:07:44 +0000 |
---|---|---|
committer | Paweł Kołodziejski | 2003-12-24 18:07:44 +0000 |
commit | 3c53d00fe6b65157ad5b64048b1f506d1539d7eb (patch) | |
tree | a796fc9c0aebb50fcf1ffd9055fc2c73ad2b8e53 | |
parent | 3fe9778b04c7c65db30300d598ee0e90df8e524e (diff) | |
download | scummvm-rg350-3c53d00fe6b65157ad5b64048b1f506d1539d7eb.tar.gz scummvm-rg350-3c53d00fe6b65157ad5b64048b1f506d1539d7eb.tar.bz2 scummvm-rg350-3c53d00fe6b65157ad5b64048b1f506d1539d7eb.zip |
removed usage auto free flag, and fixed stupid bug related with sample size
svn-id: r11896
-rw-r--r-- | scumm/imuse_digi.cpp | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/scumm/imuse_digi.cpp b/scumm/imuse_digi.cpp index a1dbcc51b2..79e9dc53cb 100644 --- a/scumm/imuse_digi.cpp +++ b/scumm/imuse_digi.cpp @@ -794,11 +794,9 @@ void IMuseDigital::mixerCallback() { _channel[l].toBeRemoved = true; } - mixer_size &= ~1; // Size *must* be even, after all this is stereo data - if (_scumm->_mixer->isReady()) { if (!_channel[l].handle.isActive()) - _scumm->_mixer->newStream(&_channel[l].handle, _channel[l].freq, + _scumm->_mixer->newStream(&_channel[l].handle, _channel[l].freq, _channel[l].mixerFlags, 100000); _scumm->_mixer->setChannelVolume(_channel[l].handle, _channel[l].vol / 1000); _scumm->_mixer->setChannelPan(_channel[l].handle, _channel[l].pan); @@ -837,13 +835,13 @@ void IMuseDigital::startSound(int sound) { if (READ_UINT32(ptr) == MKID('Crea')) { byte *t_ptr= readCreativeVocFile(ptr, size, _channel[l].freq); _channel[l].mixerSize = _channel[l].freq * 2; - _channel[l].size = size; + _channel[l].size = size * 2; _channel[l].bits = 8; _channel[l].channels = 2; - _channel[l].mixerFlags = SoundMixer::FLAG_STEREO | SoundMixer::FLAG_REVERSE_STEREO | SoundMixer::FLAG_UNSIGNED | SoundMixer::FLAG_AUTOFREE; - _channel[l].data = (byte *)malloc(size); + _channel[l].mixerFlags = SoundMixer::FLAG_STEREO | SoundMixer::FLAG_REVERSE_STEREO | SoundMixer::FLAG_UNSIGNED; + _channel[l].data = (byte *)malloc(_channel[l].size); - for (t = 0; t < size / 2; t++) { + for (t = 0; t < _channel[l].size / 2; t++) { *(_channel[l].data + t * 2 + 0) = *(t_ptr + t); *(_channel[l].data + t * 2 + 1) = *(t_ptr + t); } @@ -933,7 +931,7 @@ void IMuseDigital::startSound(int sound) { } } - _channel[l].mixerFlags = SoundMixer::FLAG_STEREO | SoundMixer::FLAG_REVERSE_STEREO | SoundMixer::FLAG_AUTOFREE; + _channel[l].mixerFlags = SoundMixer::FLAG_STEREO | SoundMixer::FLAG_REVERSE_STEREO; _channel[l].mixerSize = _channel[l].freq * 2; if (_channel[l].bits == 12) { |