[Scummvm-cvs-logs] CVS: scummvm/sound mixer.cpp,1.49,1.50

Max Horn fingolfin at users.sourceforge.net
Sun Jun 22 06:51:06 CEST 2003


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

Modified Files:
	mixer.cpp 
Log Message:
don't memset the output buffer to 0 if _eof_flag is set; rather, we should 'add 0' to every byte in the output buffer, i.e.: do nothing

Index: mixer.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sound/mixer.cpp,v
retrieving revision 1.49
retrieving revision 1.50
diff -u -d -r1.49 -r1.50
--- mixer.cpp	22 Jun 2003 13:48:47 -0000	1.49
+++ mixer.cpp	22 Jun 2003 13:50:46 -0000	1.50
@@ -1077,7 +1077,6 @@
 void ChannelVorbis::mix(int16 *data, uint len) {
 
 	if (_eof_flag) {
-		memset(data, 0, sizeof(int16) * 2 * len);
 		return;
 	}
 
@@ -1099,21 +1098,18 @@
 		if (result == 0) {
 			_eof_flag = true;
 			memset(read_pos, 0, len_left);
-			break;
-		}
-		else if (result == OV_HOLE) {
+			len_left = 0;
+		} else if (result == OV_HOLE) {
 			// Possibly recoverable, just warn about it
 			warning("Corrupted data in Vorbis file");
-		}
-		else if (result < 0) {
+		} else if (result < 0) {
 			debug(1, "Decode error %d in Vorbis file", result);
 			// Don't delete it yet, that causes problems in
 			// the CD player emulation code.
 			_eof_flag = true;
 			memset(read_pos, 0, len_left);
-			break;
-		}
-		else {
+			len_left = 0;
+		} else {
 			len_left -= result;
 			read_pos += result;
 		}





More information about the Scummvm-git-logs mailing list