aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--simon/sound.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/simon/sound.cpp b/simon/sound.cpp
index 011027879b..1fca707b40 100644
--- a/simon/sound.cpp
+++ b/simon/sound.cpp
@@ -203,7 +203,11 @@ void MP3Sound::playSound(uint sound, PlayingSoundHandle *handle, byte flags)
_file->seek(_offsets[sound], SEEK_SET);
- uint32 size = _offsets[sound+1] - _offsets[sound];
+ int i = 1;
+ while (_offsets[sound + i] == _offsets[sound])
+ i++;
+
+ uint32 size = _offsets[sound + i] - _offsets[sound];
_mixer->playMP3(handle, _file, size);
}
@@ -223,7 +227,11 @@ void VorbisSound::playSound(uint sound, PlayingSoundHandle *handle, byte flags)
_file->seek(_offsets[sound], SEEK_SET);
- uint32 size = _offsets[sound+1] - _offsets[sound];
+ int i = 1;
+ while (_offsets[sound + i] == _offsets[sound])
+ i++;
+
+ uint32 size = _offsets[sound + i] - _offsets[sound];
_mixer->playVorbis(handle, _file, size);
}