[Scummvm-cvs-logs] CVS: scummvm/scumm imuse_digi.cpp,1.73,1.74

Pawel Kolodziejski aquadran at users.sourceforge.net
Wed Dec 24 10:08:02 CET 2003


Update of /cvsroot/scummvm/scummvm/scumm
In directory sc8-pr-cvs1:/tmp/cvs-serv13077

Modified Files:
	imuse_digi.cpp 
Log Message:
removed usage auto free flag, and fixed stupid bug related with sample size

Index: imuse_digi.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/imuse_digi.cpp,v
retrieving revision 1.73
retrieving revision 1.74
diff -u -d -r1.73 -r1.74
--- imuse_digi.cpp	24 Dec 2003 17:47:43 -0000	1.73
+++ imuse_digi.cpp	24 Dec 2003 18:07:44 -0000	1.74
@@ -794,11 +794,9 @@
 				_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 @@
 			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 @@
 					}
 				}
 
-				_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) {





More information about the Scummvm-git-logs mailing list