[Scummvm-cvs-logs] CVS: scummvm/sound audiostream.cpp,1.30,1.31 mixer.cpp,1.104,1.105

Max Horn fingolfin at users.sourceforge.net
Tue Aug 5 11:18:06 CEST 2003


Update of /cvsroot/scummvm/scummvm/sound
In directory sc8-pr-cvs1:/tmp/cvs-serv31090

Modified Files:
	audiostream.cpp mixer.cpp 
Log Message:
more cleanup

Index: audiostream.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sound/audiostream.cpp,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -d -r1.30 -r1.31
--- audiostream.cpp	5 Aug 2003 18:12:59 -0000	1.30
+++ audiostream.cpp	5 Aug 2003 18:17:26 -0000	1.31
@@ -207,7 +207,6 @@
 	int _curChannel;
 	File *_file;
 	byte *_ptr;
-	int _rate;
 
 	bool init();
 	void refill(bool first = false);
@@ -222,7 +221,7 @@
 	bool eos() const			{ return eosIntern(); }
 	bool isStereo() const		{ return _isStereo; }
 	
-	int getRate() const			{ return _rate; }
+	int getRate() const			{ return _frame.header.samplerate; }
 };
 
 
@@ -251,7 +250,6 @@
 	_curChannel = 0;
 	_file = file;
 	_ptr = (byte *)malloc(_bufferSize + MAD_BUFFER_GUARD);
-	_rate = 0;
 
 	init();
 
@@ -303,9 +301,6 @@
 			return false;
 	}
 	
-	// Determine the sample rate
-	_rate = _frame.header.samplerate;
-
 	return true;
 }
 

Index: mixer.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sound/mixer.cpp,v
retrieving revision 1.104
retrieving revision 1.105
diff -u -d -r1.104 -r1.105
--- mixer.cpp	5 Aug 2003 02:05:37 -0000	1.104
+++ mixer.cpp	5 Aug 2003 18:17:26 -0000	1.105
@@ -67,12 +67,7 @@
 		const int volume = isMusicChannel() ? _mixer->getMusicVolume() : _mixer->getVolume();
 		_converter->flow(*_input, data, len, volume);
 	}
-	void destroy() {
-		for (int i = 0; i != SoundMixer::NUM_CHANNELS; i++)
-			if (_mixer->_channels[i] == this)
-				_mixer->_channels[i] = 0;
-		delete this;
-	}
+	void destroy();
 	virtual bool isMusicChannel() const	= 0;
 };
 
@@ -140,12 +135,7 @@
 	   16 bits, for a total of 40 bytes.
 	 */
 	virtual void mix(int16 *data, uint len) = 0;
-	void destroy() {
-		for (int i = 0; i != SoundMixer::NUM_CHANNELS; i++)
-			if (_mixer->_channels[i] == this)
-				_mixer->_channels[i] = 0;
-		delete this;
-	}
+	void destroy();
 	virtual bool isMusicChannel() const	= 0;
 };
 
@@ -244,6 +234,13 @@
 #endif
 
 
+void Channel::destroy() {
+	for (int i = 0; i != SoundMixer::NUM_CHANNELS; i++)
+		if (_mixer->_channels[i] == this)
+			_mixer->_channels[i] = 0;
+	delete this;
+}
+
 SoundMixer::SoundMixer() {
 	_syst = 0;
 	_mutex = 0;
@@ -365,6 +362,7 @@
 	if (_premixProc && !_paused) {
 		int i;
 		_premixProc(_premixParam, buf, len);
+		// Convert mono data from the premix proc to stereo
 		for (i = (len - 1); i >= 0; i--) {
 			buf[2 * i] = buf[2 * i + 1] = buf[i];
 		}





More information about the Scummvm-git-logs mailing list