[Scummvm-cvs-logs] SF.net SVN: scummvm: [31627] scummvm/trunk/engines/made/pmvplayer.cpp

eriktorbjorn at users.sourceforge.net eriktorbjorn at users.sourceforge.net
Sun Apr 20 21:17:36 CEST 2008


Revision: 31627
          http://scummvm.svn.sourceforge.net/scummvm/?rev=31627&view=rev
Author:   eriktorbjorn
Date:     2008-04-20 12:17:36 -0700 (Sun, 20 Apr 2008)

Log Message:
-----------
Made the sound less choppy. Though we may have to do some kind of double
buffering here to completely fix the problem.

Modified Paths:
--------------
    scummvm/trunk/engines/made/pmvplayer.cpp

Modified: scummvm/trunk/engines/made/pmvplayer.cpp
===================================================================
--- scummvm/trunk/engines/made/pmvplayer.cpp	2008-04-20 19:16:34 UTC (rev 31626)
+++ scummvm/trunk/engines/made/pmvplayer.cpp	2008-04-20 19:17:36 UTC (rev 31627)
@@ -50,6 +50,12 @@
 
 	//FILE *raw = fopen("track.raw", "wb");
 
+	uint32 frameCount = 0;
+
+	// TODO: Sound can still be a little choppy. A bug in the decoder or -
+	// perhaps more likely - do we have to implement double buffering to
+	// get it to work well?
+
 	while (!_abort && !_fd->eof()) {
 
 		readChunk(chunkType, chunkSize);
@@ -100,7 +106,11 @@
 
 		delete[] frameData;
 
-		_system->delayMillis(frameDelay);
+		frameCount++;
+
+		while (_mixer->getSoundElapsedTime(_audioStreamHandle) < frameCount * frameDelay) {
+			_system->delayMillis(10);
+		}
 	}
 
 	_audioStream->finish();


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list