aboutsummaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorSven Hesse2008-12-12 17:12:05 +0000
committerSven Hesse2008-12-12 17:12:05 +0000
commit052e83cd2421f14c24063ab424b465f2029c5bf3 (patch)
tree68bdb81cdb7a628c09118df5e5bfc9f47cc51fca /sound
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
Diffstat (limited to 'sound')
-rw-r--r--sound/audiostream.cpp18
1 files changed, 2 insertions, 16 deletions
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) {