diff options
author | Retro-Junk | 2017-01-25 00:05:42 +0300 |
---|---|---|
committer | Eugene Sandulenko | 2017-01-25 22:42:26 +0100 |
commit | 7e4043ec8595cd083c4966cfa001958912071932 (patch) | |
tree | 80f50e28dc71481d74b56f68b38e914f29383fe1 /engines/cryo | |
parent | 30eb57b4b26efa6222270fd6712996a277ec8698 (diff) | |
download | scummvm-rg350-7e4043ec8595cd083c4966cfa001958912071932.tar.gz scummvm-rg350-7e4043ec8595cd083c4966cfa001958912071932.tar.bz2 scummvm-rg350-7e4043ec8595cd083c4966cfa001958912071932.zip |
CRYO: Fix broken sound in FMV scenes
Diffstat (limited to 'engines/cryo')
-rw-r--r-- | engines/cryo/bugs.txt | 1 | ||||
-rw-r--r-- | engines/cryo/sound.cpp | 14 | ||||
-rw-r--r-- | engines/cryo/sound.h | 2 |
3 files changed, 13 insertions, 4 deletions
diff --git a/engines/cryo/bugs.txt b/engines/cryo/bugs.txt index 12d0951737..5f3c47e0e4 100644 --- a/engines/cryo/bugs.txt +++ b/engines/cryo/bugs.txt @@ -16,5 +16,4 @@ E. Bogus hitbox in upper right corner of mirror screen (under mini-map) F. Wrong frescoes cursor on PC G. Junk on a valley entrance screen on PC H. On PC, no sound during first Mungo's dialogue, memory corruption after that -I. Crackling sound in HNM videos (ex. Mac intro video) J. PC intro video is out of sync with background voice, crashes later diff --git a/engines/cryo/sound.cpp b/engines/cryo/sound.cpp index b653e60ec2..1176ccec90 100644 --- a/engines/cryo/sound.cpp +++ b/engines/cryo/sound.cpp @@ -41,12 +41,22 @@ CSoundChannel::~CSoundChannel() { delete _audioStream;
}
-void CSoundChannel::queueBuffer(byte *buffer, unsigned int size, bool playNow, bool playQueue) {
+void CSoundChannel::queueBuffer(byte *buffer, unsigned int size, bool playNow, bool playQueue, bool buffering = true) {
if (playNow)
stop();
+
+ if (!buffer || !size)
+ return;
+
if (!_audioStream)
_audioStream = Audio::makeQueuingAudioStream(_sampleRate, _stereo);
- _audioStream->queueBuffer(buffer, size, DisposeAfterUse::NO, _bufferFlags);
+
+ if (buffering) {
+ byte *localBuffer = (byte*)malloc(size);
+ memcpy(localBuffer, buffer, size);
+ _audioStream->queueBuffer(localBuffer, size, DisposeAfterUse::YES, _bufferFlags);
+ } else
+ _audioStream->queueBuffer(buffer, size, DisposeAfterUse::NO, _bufferFlags);
if (playNow || playQueue)
play();
}
diff --git a/engines/cryo/sound.h b/engines/cryo/sound.h index 2136c658a4..b05c08ea71 100644 --- a/engines/cryo/sound.h +++ b/engines/cryo/sound.h @@ -48,7 +48,7 @@ public: ~CSoundChannel();
// Queue a new buffer, cancel any previously queued buffers if playNow is set
- void queueBuffer(byte *buffer, unsigned int size, bool playNow = false, bool playQueue = true);
+ void queueBuffer(byte *buffer, unsigned int size, bool playNow = false, bool playQueue = true, bool buffering = true);
// Play any queued buffers
void play();
|