aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorTorbjörn Andersson2008-04-20 19:17:36 +0000
committerTorbjörn Andersson2008-04-20 19:17:36 +0000
commit179479f6f4cb24bedd0c3e21c2af04d4b3f17e2a (patch)
treed5f774e079b3a65b35f5a7c5bfdcbdd53445e586 /engines
parentbd1cee2104b7f4e29dc299eaa9ebde61c390972a (diff)
downloadscummvm-rg350-179479f6f4cb24bedd0c3e21c2af04d4b3f17e2a.tar.gz
scummvm-rg350-179479f6f4cb24bedd0c3e21c2af04d4b3f17e2a.tar.bz2
scummvm-rg350-179479f6f4cb24bedd0c3e21c2af04d4b3f17e2a.zip
Made the sound less choppy. Though we may have to do some kind of double
buffering here to completely fix the problem. svn-id: r31627
Diffstat (limited to 'engines')
-rw-r--r--engines/made/pmvplayer.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/engines/made/pmvplayer.cpp b/engines/made/pmvplayer.cpp
index f1e692973f..dbb8d02a48 100644
--- a/engines/made/pmvplayer.cpp
+++ b/engines/made/pmvplayer.cpp
@@ -50,6 +50,12 @@ void PmvPlayer::play(const char *filename) {
//FILE *raw = fopen("track.raw", "wb");
+ uint32 frameCount = 0;
+
+ // TODO: Sound can still be a little choppy. A bug in the decoder or -
+ // perhaps more likely - do we have to implement double buffering to
+ // get it to work well?
+
while (!_abort && !_fd->eof()) {
readChunk(chunkType, chunkSize);
@@ -100,7 +106,11 @@ void PmvPlayer::play(const char *filename) {
delete[] frameData;
- _system->delayMillis(frameDelay);
+ frameCount++;
+
+ while (_mixer->getSoundElapsedTime(_audioStreamHandle) < frameCount * frameDelay) {
+ _system->delayMillis(10);
+ }
}
_audioStream->finish();