[Scummvm-cvs-logs] CVS: scummvm/scumm imuse_digi.cpp,1.20,1.21 sound.cpp,1.138,1.139

Max Horn fingolfin at users.sourceforge.net
Sat Jun 21 14:18:02 CEST 2003


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

Modified Files:
	imuse_digi.cpp sound.cpp 
Log Message:
modified & cleaned up the playStream/append code a bit; but this API really could stand some refinement

Index: imuse_digi.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/imuse_digi.cpp,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- imuse_digi.cpp	15 Jun 2003 01:42:15 -0000	1.20
+++ imuse_digi.cpp	21 Jun 2003 21:17:08 -0000	1.21
@@ -821,13 +821,14 @@
 
 			if (_scumm->_silentDigitalImuse == false) {
 				if (_channel[l]._initialized == false) {
-					_scumm->_mixer->playStream(NULL, l, buf, mixer_size,
+					_scumm->_mixer->playStream(l, buf, mixer_size,
 					                           _channel[l]._freq, _channel[l]._mixerFlags, 3, 100000);
 					_channel[l]._initialized = true;
 				} else {
-					_scumm->_mixer->append(l, buf, mixer_size, _channel[l]._freq, _channel[l]._mixerFlags);
+					_scumm->_mixer->append(l, buf, mixer_size);
 				}
 			}
+			free(buf);
 		}
 	}
 }
@@ -860,7 +861,7 @@
 				_channel[l]._bits = 8;
 				_channel[l]._channels = 2;
 				_channel[l]._mixerSize = (22050 / 5) * 2;
-				_channel[l]._mixerFlags = SoundMixer::FLAG_AUTOFREE | SoundMixer::FLAG_STEREO | SoundMixer::FLAG_REVERSE_STEREO | SoundMixer::FLAG_UNSIGNED;
+				_channel[l]._mixerFlags = SoundMixer::FLAG_STEREO | SoundMixer::FLAG_REVERSE_STEREO | SoundMixer::FLAG_UNSIGNED;
 				byte * t_ptr= readCreativeVocFile(ptr, size, _channel[l]._freq, _channel[l]._numLoops);
 
 				if (_channel[l]._freq == 22222) {
@@ -960,7 +961,7 @@
 					}
 				}
 				_channel[l]._mixerSize = (22050 / 5) * 2;
-				_channel[l]._mixerFlags = SoundMixer::FLAG_AUTOFREE | SoundMixer::FLAG_STEREO | SoundMixer::FLAG_REVERSE_STEREO;
+				_channel[l]._mixerFlags = SoundMixer::FLAG_STEREO | SoundMixer::FLAG_REVERSE_STEREO;
 				if (_channel[l]._bits == 12) {
 					_channel[l]._mixerSize *= 2;
 					_channel[l]._mixerFlags |= SoundMixer::FLAG_16BITS;

Index: sound.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/sound.cpp,v
retrieving revision 1.138
retrieving revision 1.139
diff -u -d -r1.138 -r1.139
--- sound.cpp	19 Jun 2003 12:29:13 -0000	1.138
+++ sound.cpp	21 Jun 2003 21:17:08 -0000	1.139
@@ -1170,18 +1170,18 @@
 		final_size = _outputMixerSize;
 		memcpy(buffer, ptr, _outputMixerSize);
 	} else {
-		warning("Sound::bundleMusicHandler  to do more playStream options...");
+		warning("Sound::bundleMusicHandler TODO: more playStream options...");
 		return;
 	}
 
 	_bundleMusicPosition += final_size;
 	if (_bundleMusicTrack == -1) {
-		_bundleMusicTrack = _scumm->_mixer->playStream(NULL, _scumm->_mixer->_beginSlots - 1, buffer, final_size, rate,
-															SoundMixer::FLAG_AUTOFREE | SoundMixer::FLAG_16BITS | SoundMixer::FLAG_STEREO, -1, 300000);
+		_bundleMusicTrack = _scumm->_mixer->playStream(_scumm->_mixer->_beginSlots - 1, buffer, final_size, rate,
+															SoundMixer::FLAG_16BITS | SoundMixer::FLAG_STEREO, -1, 300000);
 	} else {
-		_scumm->_mixer->append(_bundleMusicTrack, buffer, final_size, rate,
-														SoundMixer::FLAG_AUTOFREE | SoundMixer::FLAG_16BITS | SoundMixer::FLAG_STEREO);
+		_scumm->_mixer->append(_bundleMusicTrack, buffer, final_size);
 	}
+	free(buffer);
 }
 
 int Sound::playBundleSound(char *sound) {





More information about the Scummvm-git-logs mailing list