From 6bf1e10768e5d3d71bd9e06fe2000254f6dbd955 Mon Sep 17 00:00:00 2001 From: Torbjörn Andersson Date: Wed, 17 May 2006 20:54:51 +0000 Subject: Fixed two off-by-one errors. One would cause the same frame of the Kyra 3 to be displayed twice in a row. The other, more serious one, would cause ScummVM to crash when reaching the end of the music. Now the music loops properly. (It does fade down before looping, but that's how it is in the original as well. It's just the way the music is recorded.) svn-id: r22503 --- engines/kyra/sound_digital.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'engines/kyra/sound_digital.cpp') diff --git a/engines/kyra/sound_digital.cpp b/engines/kyra/sound_digital.cpp index a41ca053ef..755bc710cd 100644 --- a/engines/kyra/sound_digital.cpp +++ b/engines/kyra/sound_digital.cpp @@ -133,7 +133,9 @@ int AUDStream::readChunk(int16 *buffer, const int maxSamples) { // if no bytes of the old chunk are left, read the next one if (_bytesLeft <= 0) { - if (_processedSize > _totalSize) { + if (_processedSize >= _totalSize) { + // TODO: Eventually, we're probably going to need the + // ability to loop the sound. Add this here? _endOfData = true; return 0; } -- cgit v1.2.3