aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorSven Hesse2007-08-14 01:48:37 +0000
committerSven Hesse2007-08-14 01:48:37 +0000
commit22996d1cd9b94946a0413d89df8bc06b7bfbb78e (patch)
tree8bd316161521fb0b92977fc51e92cca83d3d1089 /engines
parente7e26ad7679adde7d9749aa583ee63a432ec1e60 (diff)
downloadscummvm-rg350-22996d1cd9b94946a0413d89df8bc06b7bfbb78e.tar.gz
scummvm-rg350-22996d1cd9b94946a0413d89df8bc06b7bfbb78e.tar.bz2
scummvm-rg350-22996d1cd9b94946a0413d89df8bc06b7bfbb78e.zip
Fixed talking videos sync
svn-id: r28605
Diffstat (limited to 'engines')
-rw-r--r--engines/gob/coktelvideo.cpp35
1 files changed, 18 insertions, 17 deletions
diff --git a/engines/gob/coktelvideo.cpp b/engines/gob/coktelvideo.cpp
index e8a63a6fe7..f4fa52481c 100644
--- a/engines/gob/coktelvideo.cpp
+++ b/engines/gob/coktelvideo.cpp
@@ -949,7 +949,7 @@ bool Vmd::load(Common::SeekableReadStream &stream) {
if (_frames[i].parts[j].type == kPartTypeAudio) {
_frames[i].parts[j].flags = _stream->readByte();
- _stream->skip(9); // Unknow
+ _stream->skip(9); // Unknown
} else if (_frames[i].parts[j].type == kPartTypeVideo) {
@@ -1093,11 +1093,17 @@ CoktelVideo::State Vmd::processFrame(uint16 frame) {
// Empty sound slice
} else if (part.flags == 3) {
- if (_soundEnabled && (part.size > 0))
- emptySoundSlice(part.size);
- else
- _stream->skip(part.size);
+ if (_soundEnabled) {
+ emptySoundSlice(_soundSliceSize);
+
+ if (_soundStage == 1)
+ startSound = true;
+ }
+ _stream->skip(part.size);
+ } else {
+ warning("Unknown sound part type %d", part.flags);
+ _stream->skip(part.size);
}
} else if (part.type == kPartTypeVideo) {
@@ -1256,23 +1262,18 @@ void Vmd::filledSoundSlice(uint32 size) {
}
void Vmd::filledSoundSlices(uint32 size, uint32 mask) {
- if (_soundBytesPerSample == 1) {
- soundSlice8bit(size);
- return;
- }
-
- for (int i = 0; i < (_soundSlicesCount - 1); i++) {
+ int n = MIN<int>(_soundSlicesCount - 1, 31);
+ for (int i = 0; i < n; i++) {
if (mask & 1)
- emptySoundSlice(_soundSliceSize * 2);
- else {
- int16 init = _stream->readSint16LE();
- soundSlice16bit(_soundSliceSize, init);
- }
+ emptySoundSlice(_soundSliceSize * _soundBytesPerSample);
+ else
+ filledSoundSlice(_soundSliceSize);
mask >>= 1;
}
-
+ if (_soundSlicesCount > 32)
+ filledSoundSlice((_soundSlicesCount - 32) * _soundSliceSize);
}
void Vmd::deDPCM(byte *soundBuf, byte *dataBuf, int16 &init, uint32 n) {