[Scummvm-cvs-logs] scummvm master -> 9c14f4419b4b9f573d4a955be136108e575266fe
lordhoto
lordhoto at gmail.com
Mon Jun 11 20:38:25 CEST 2012
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
9c14f4419b AUDIO: Make VOC decoder a bit more failsafe by still playing parts of invalid VOC files.
Commit: 9c14f4419b4b9f573d4a955be136108e575266fe
https://github.com/scummvm/scummvm/commit/9c14f4419b4b9f573d4a955be136108e575266fe
Author: Johannes Schickel (lordhoto at scummvm.org)
Date: 2012-06-11T11:37:04-07:00
Commit Message:
AUDIO: Make VOC decoder a bit more failsafe by still playing parts of invalid VOC files.
Formerly when an unsupported block was found the opening would fail. Instead
now all the valid blocks till that occasion will be played.
This fixes an missing sound in Full Throttle (thanks to clone2727 for
reporting), which is using a VOC file which fails to specify the proper block
length for its sound block.
Changed paths:
audio/decoders/voc.cpp
diff --git a/audio/decoders/voc.cpp b/audio/decoders/voc.cpp
index f0b5b27..fa330c6 100644
--- a/audio/decoders/voc.cpp
+++ b/audio/decoders/voc.cpp
@@ -321,9 +321,14 @@ void VocStream::preProcess() {
// In case we hit a "Terminator" block we also break here.
if (_stream->eos() || block.code == 0)
break;
- // We also allow 128 as terminator, since Simon 1 Amiga CD32 uses it.
- if (block.code == 128) {
- debug(3, "VocStream::preProcess: Caught 128 as terminator");
+ // We will allow invalid block numbers as terminators. This is needed,
+ // since some games ship broken VOC files. The following occasions are
+ // known:
+ // - 128 is used as terminator in Simon 1 Amiga CD32
+ // - Full Throttle contains a VOC file with an incorrect block length
+ // resulting in a sample (127) to be read as block code.
+ if (block.code > 9) {
+ warning("VocStream::preProcess: Caught %d as terminator", block.code);
break;
}
@@ -482,7 +487,8 @@ void VocStream::preProcess() {
default:
warning("Unhandled code %d in VOC file (len %d)", block.code, block.length);
- return;
+ // Skip the whole block and try to use the next one.
+ skip = block.length;
}
// Premature end of stream => error!
More information about the Scummvm-git-logs
mailing list