[Scummvm-cvs-logs] SF.net SVN: scummvm:[35315] scummvm/trunk/engines/gob

drmccoy at users.sourceforge.net drmccoy at users.sourceforge.net
Fri Dec 12 15:28:06 CET 2008


Revision: 35315
          http://scummvm.svn.sourceforge.net/scummvm/?rev=35315&view=rev
Author:   drmccoy
Date:     2008-12-12 14:28:06 +0000 (Fri, 12 Dec 2008)

Log Message:
-----------
Using AppandableAudioStream::getTotalPlayTime() instead of the difference between current and start time to sync audio and video

Modified Paths:
--------------
    scummvm/trunk/engines/gob/coktelvideo.cpp
    scummvm/trunk/engines/gob/coktelvideo.h

Modified: scummvm/trunk/engines/gob/coktelvideo.cpp
===================================================================
--- scummvm/trunk/engines/gob/coktelvideo.cpp	2008-12-12 14:23:02 UTC (rev 35314)
+++ scummvm/trunk/engines/gob/coktelvideo.cpp	2008-12-12 14:28:06 UTC (rev 35315)
@@ -330,7 +330,7 @@
 
 		if (_skipFrames == 0) {
 			int32 waitTime = (int16) (((_curFrame * _soundSliceLength) -
-				((g_system->getMillis() - _soundStartTime) << 16)) >> 16);
+				(_audioStream->getTotalPlayTime() << 16)) >> 16);
 
 			if (waitTime < 0) {
 				_skipFrames = -waitTime / (_soundSliceLength >> 16);
@@ -344,11 +344,6 @@
 		g_system->delayMillis(_frameLength);
 }
 
-void Imd::notifyPaused(uint32 duration) {
-	if (_soundStage == 2)
-		_soundStartTime += duration;
-}
-
 void Imd::copyCurrentFrame(byte *dest,
 		uint16 left, uint16 top, uint16 width, uint16 height,
 		uint16 x, uint16 y, uint16 pitch, int16 transp) {
@@ -444,7 +439,6 @@
 	_hasSound = false;
 	_soundEnabled = false;
 	_soundStage = 0;
-	_soundStartTime = 0;
 	_skipFrames = 0;
 
 	_soundFlags = 0;
@@ -638,7 +632,6 @@
 
 	if (startSound && _soundEnabled) {
 		_mixer->playInputStream(Audio::Mixer::kSFXSoundType, &_audioHandle, _audioStream);
-		_soundStartTime = g_system->getMillis();
 		_skipFrames = 0;
 		_soundStage = 2;
 	}
@@ -1276,7 +1269,6 @@
 
 	if (startSound && _soundEnabled) {
 		_mixer->playInputStream(Audio::Mixer::kSFXSoundType, &_audioHandle, _audioStream);
-		_soundStartTime = g_system->getMillis();
 		_skipFrames = 0;
 		_soundStage = 2;
 	}

Modified: scummvm/trunk/engines/gob/coktelvideo.h
===================================================================
--- scummvm/trunk/engines/gob/coktelvideo.h	2008-12-12 14:23:02 UTC (rev 35314)
+++ scummvm/trunk/engines/gob/coktelvideo.h	2008-12-12 14:28:06 UTC (rev 35315)
@@ -215,6 +215,8 @@
 	bool hasExtraData(const char *fileName) const { return false; }
 	Common::MemoryReadStream *getExtraData(const char *fileName) { return 0; }
 
+	void notifyPaused(uint32 duration) { }
+
 	void setFrameRate(int16 frameRate);
 
 	bool load(Common::SeekableReadStream &stream);
@@ -234,8 +236,6 @@
 	State nextFrame();
 	void waitEndFrame();
 
-	void notifyPaused(uint32 duration);
-
 	void copyCurrentFrame(byte *dest,
 			uint16 left, uint16 top, uint16 width, uint16 height,
 			uint16 x, uint16 y, uint16 pitch, int16 transp = -1);
@@ -272,7 +272,6 @@
 	bool _hasSound;
 	bool _soundEnabled;
 	uint8 _soundStage; // (0: no sound, 1: loaded, 2: playing)
-	uint32 _soundStartTime;
 	uint32 _skipFrames;
 
 	uint16 _soundFlags;


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