mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-22 12:12:16 +00:00
CRYO: Fix broken sound in FMV scenes
This commit is contained in:
parent
30eb57b4b2
commit
7e4043ec85
@ -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
|
||||
|
@ -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();
|
||||
}
|
||||
|
@ -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();
|
||||
|
Loading…
x
Reference in New Issue
Block a user