[Scummvm-cvs-logs] CVS: scummvm/sound rate.cpp,1.20,1.21

Max Horn fingolfin at users.sourceforge.net
Sat Aug 2 11:30:06 CEST 2003


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

Modified Files:
	rate.cpp 
Log Message:
slightly cut down on the number of times eof() is called

Index: rate.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sound/rate.cpp,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- rate.cpp	2 Aug 2003 17:22:52 -0000	1.20
+++ rate.cpp	2 Aug 2003 18:29:52 -0000	1.21
@@ -117,10 +117,15 @@
 	ostart = obuf;
 	oend = obuf + *osamp * 2;
 
-	while (obuf < oend && !input.eof()) {
+	while (obuf < oend) {
 
 		// read enough input samples so that ipos > opos
 		while (ipos <= opos + 1) {
+
+			// Abort if we reached the end of the input buffer
+			if (input.eof())
+				goto the_end;
+
 			ilast[0] = icur[0];
 			icur[0] = input.read();
 			if (stereo) {
@@ -128,10 +133,6 @@
 				icur[1] = input.read();
 			}
 			ipos++;
-
-			// Abort if we reached the end of the input buffer
-			if (input.eof())
-				goto the_end;
 		}
 
 		// Loop as long as the outpos trails behind, and as long as there is





More information about the Scummvm-git-logs mailing list