aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSven Hesse2008-12-12 17:12:05 +0000
committerSven Hesse2008-12-12 17:12:05 +0000
commit052e83cd2421f14c24063ab424b465f2029c5bf3 (patch)
tree68bdb81cdb7a628c09118df5e5bfc9f47cc51fca
parentcbdb105d8ebcc5720c010c713ac31ab9d01485b9 (diff)
downloadscummvm-rg350-052e83cd2421f14c24063ab424b465f2029c5bf3.tar.gz
scummvm-rg350-052e83cd2421f14c24063ab424b465f2029c5bf3.tar.bz2
scummvm-rg350-052e83cd2421f14c24063ab424b465f2029c5bf3.zip
Okay, removing my implementation of AppandableAudioStream::getTotalPlayTime (I've apparently misunderstood its intent) and using Mixer::getSoundElapsedTime() instead
svn-id: r35317
-rw-r--r--engines/gob/coktelvideo.cpp2
-rw-r--r--engines/tinsel/bmv.cpp2
-rw-r--r--sound/audiostream.cpp18
3 files changed, 4 insertions, 18 deletions
diff --git a/engines/gob/coktelvideo.cpp b/engines/gob/coktelvideo.cpp
index cb3449615b..b5eb781294 100644
--- a/engines/gob/coktelvideo.cpp
+++ b/engines/gob/coktelvideo.cpp
@@ -330,7 +330,7 @@ void Imd::waitEndFrame() {
if (_skipFrames == 0) {
int32 waitTime = (int16) (((_curFrame * _soundSliceLength) -
- (_audioStream->getTotalPlayTime() << 16)) >> 16);
+ (_mixer->getSoundElapsedTime(_audioHandle) << 16)) >> 16);
if (waitTime < 0) {
_skipFrames = -waitTime / (_soundSliceLength >> 16);
diff --git a/engines/tinsel/bmv.cpp b/engines/tinsel/bmv.cpp
index 613d8c9686..15da5823fc 100644
--- a/engines/tinsel/bmv.cpp
+++ b/engines/tinsel/bmv.cpp
@@ -1243,7 +1243,7 @@ int32 MovieAudioLag(void) {
// 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) {
diff --git a/sound/audiostream.cpp b/sound/audiostream.cpp
index 4c10bfe1a3..6334d26e47 100644
--- a/sound/audiostream.cpp
+++ b/sound/audiostream.cpp
@@ -149,7 +149,6 @@ public:
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 @@ protected:
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 @@ public:
void finish() { _finalized = true; }
- int32 getTotalPlayTime() const { return _playTime; }
-
void queueBuffer(byte *data, uint32 size);
};
@@ -297,7 +290,7 @@ public:
};
BaseAppendableMemoryStream::BaseAppendableMemoryStream(int rate)
- : _finalized(false), _rate(rate), _pos(0), _playTime(0), _playSamp(0) {
+ : _finalized(false), _rate(rate), _pos(0) {
}
@@ -335,14 +328,7 @@ int AppendableMemoryStream<stereo, is16Bit, isUnsigned, isLE>::readBuffer(int16
} 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) {