[Scummvm-cvs-logs] CVS: scummvm/sword2/driver d_draw.cpp,1.46,1.47

Torbj?rn Andersson eriktorbjorn at users.sourceforge.net
Sun Dec 14 08:33:01 CET 2003


Update of /cvsroot/scummvm/scummvm/sword2/driver
In directory sc8-pr-cvs1:/tmp/cvs-serv30907

Modified Files:
	d_draw.cpp 
Log Message:
Fixed a potential crash bug where an audio buffer would be freed at the end
of an animated cutscene while the mixer was still using it. Oddly enough, I
didn't encounter this bug when I played through the game recently, but
today it happened every time at the end of the cutscene where Nico finds
the jaguar stone.


Index: d_draw.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sword2/driver/d_draw.cpp,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -d -r1.46 -r1.47
--- d_draw.cpp	10 Dec 2003 08:01:58 -0000	1.46
+++ d_draw.cpp	14 Dec 2003 16:32:21 -0000	1.47
@@ -215,6 +215,15 @@
 			_vm->_system->delay_msecs(90);
 		}
 
+		// Wait for the voice to stop playing. This is to make sure
+		// that we don't cut off the speech in mid-sentence, and - even
+		// more importantly - that we don't free the sound buffer while
+		// it's in use.
+
+		while (handle) {
+			_vm->_system->delay_msecs(100);
+		};
+
 		closeTextObject(text[textCounter]);
 
 		_vm->_graphics->clearScene();





More information about the Scummvm-git-logs mailing list