[Scummvm-cvs-logs] scummvm master -> b50f5a4cde4b6e3549d0c0139b52079c092d0529

eriktorbjorn eriktorbjorn at telia.com
Wed Oct 3 08:31:53 CEST 2012


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
b50f5a4cde TOLTECS: Improve audio/video sync in the movie player


Commit: b50f5a4cde4b6e3549d0c0139b52079c092d0529
    https://github.com/scummvm/scummvm/commit/b50f5a4cde4b6e3549d0c0139b52079c092d0529
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2012-10-02T23:28:02-07:00

Commit Message:
TOLTECS: Improve audio/video sync in the movie player

At least on my computer, the sound would stall frequently after a
while because the delay between frame was calculated from frame to
frame. Now it's calculated from the start of the sound instead.

Changed paths:
    engines/toltecs/movie.cpp



diff --git a/engines/toltecs/movie.cpp b/engines/toltecs/movie.cpp
index 75127d7..44b52b1 100644
--- a/engines/toltecs/movie.cpp
+++ b/engines/toltecs/movie.cpp
@@ -96,9 +96,9 @@ void MoviePlayer::playMovie(uint resIndex) {
 
 	fetchAudioChunks();
 
-	uint32 lastTime = _vm->_mixer->getSoundElapsedTime(_audioStreamHandle);
 	byte *chunkBuffer = NULL;
 	uint32 chunkBufferSize = 0;
+	uint32 frame = 0;
 
 	while (_chunkCount--) {
 		byte chunkType = _vm->_arc->readByte();
@@ -136,12 +136,11 @@ void MoviePlayer::playMovie(uint resIndex) {
 				fetchAudioChunks();
 			}
 
-			while (_vm->_mixer->getSoundElapsedTime(_audioStreamHandle) < lastTime + 111) {
+			while (_vm->_mixer->getSoundElapsedTime(_audioStreamHandle) < (1000 * frame) / 9) {
 				g_system->delayMillis(10);
 			}
 
-			lastTime = _vm->_mixer->getSoundElapsedTime(_audioStreamHandle);
-
+			frame++;
 			break;
 		case kChunkPalette:
 			unpackPalette(chunkBuffer, moviePalette, 256, 3);






More information about the Scummvm-git-logs mailing list