[Scummvm-cvs-logs] SF.net SVN: scummvm:[35317] scummvm/trunk

drmccoy at users.sourceforge.net drmccoy at users.sourceforge.net
Fri Dec 12 18:12:05 CET 2008


Revision: 35317
          http://scummvm.svn.sourceforge.net/scummvm/?rev=35317&view=rev
Author:   drmccoy
Date:     2008-12-12 17:12:05 +0000 (Fri, 12 Dec 2008)

Log Message:
-----------
Okay, removing my implementation of AppandableAudioStream::getTotalPlayTime (I've apparently misunderstood its intent) and using Mixer::getSoundElapsedTime() instead

Modified Paths:
--------------
    scummvm/trunk/engines/gob/coktelvideo.cpp
    scummvm/trunk/engines/tinsel/bmv.cpp
    scummvm/trunk/sound/audiostream.cpp

Modified: scummvm/trunk/engines/gob/coktelvideo.cpp
===================================================================
--- scummvm/trunk/engines/gob/coktelvideo.cpp	2008-12-12 15:48:38 UTC (rev 35316)
+++ scummvm/trunk/engines/gob/coktelvideo.cpp	2008-12-12 17:12:05 UTC (rev 35317)
@@ -330,7 +330,7 @@
 
 		if (_skipFrames == 0) {
 			int32 waitTime = (int16) (((_curFrame * _soundSliceLength) -
-				(_audioStream->getTotalPlayTime() << 16)) >> 16);
+				(_mixer->getSoundElapsedTime(_audioHandle) << 16)) >> 16);
 
 			if (waitTime < 0) {
 				_skipFrames = -waitTime / (_soundSliceLength >> 16);

Modified: scummvm/trunk/engines/tinsel/bmv.cpp
===================================================================
--- scummvm/trunk/engines/tinsel/bmv.cpp	2008-12-12 15:48:38 UTC (rev 35316)
+++ scummvm/trunk/engines/tinsel/bmv.cpp	2008-12-12 17:12:05 UTC (rev 35317)
@@ -1243,7 +1243,7 @@
 
 	// Calculate lag
 	int32 playLength = (movieTick - startTick - 1) * ((((uint32) 1000) << 10) / 24);
-	return (playLength - (audioStream->getTotalPlayTime() << 10)) >> 10;
+	return (playLength - (((int32) _vm->_mixer->getSoundElapsedTime(audioHandle)) << 10)) >> 10;
 }
 
 uint32 NextMovieTime(void) {

Modified: scummvm/trunk/sound/audiostream.cpp
===================================================================
--- scummvm/trunk/sound/audiostream.cpp	2008-12-12 15:48:38 UTC (rev 35316)
+++ scummvm/trunk/sound/audiostream.cpp	2008-12-12 17:12:05 UTC (rev 35317)
@@ -149,7 +149,6 @@
 	bool endOfData() const			{ return _ptr >= _end; }
 
 	int getRate() const				{ return _rate; }
-	int32 getTotalPlayTime() const	{ return _playtime; }
 };
 
 template<bool stereo, bool is16Bit, bool isUnsigned, bool isLE>
@@ -262,10 +261,6 @@
 	const int _rate;
 	byte *_pos;
 
-	// Playing time in milliseconds and rest samples
-	int _playTime;
-	int _playSamp;
-
 	inline bool eosIntern() const { return _bufferQueue.empty(); };
 public:
 	BaseAppendableMemoryStream(int rate);
@@ -278,8 +273,6 @@
 
 	void finish()				{ _finalized = true; }
 
-	int32 getTotalPlayTime() const { return _playTime; }
-
 	void queueBuffer(byte *data, uint32 size);
 };
 
@@ -297,7 +290,7 @@
 };
 
 BaseAppendableMemoryStream::BaseAppendableMemoryStream(int rate)
- : _finalized(false), _rate(rate), _pos(0), _playTime(0), _playSamp(0) {
+ : _finalized(false), _rate(rate), _pos(0) {
 
 }
 
@@ -335,14 +328,7 @@
 		} while (--len);
 	}
 
-	int written = numSamples - samples;
-
-	_playSamp += (stereo ? (written / 2) : written);
-
-	_playTime += _playSamp / (_rate / 1000);
-	_playSamp %= (_rate / 1000);
-
-	return written;
+	return numSamples - samples;
 }
 
 void BaseAppendableMemoryStream::queueBuffer(byte *data, uint32 size) {


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