mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-10 03:40:25 +00:00
TINSEL: Work around PCM playback deadlock in Noir
This workaround disables PCM playback. The PCMPlayers _chunk is NULL but _state is S_MID. As a result getNextChunk always return 1, leading to readBuffer in the playback thread never unlocking _mutex.
This commit is contained in:
parent
6fe03ab8de
commit
08b500b5e9
@ -693,6 +693,10 @@ PCMMusicPlayer::PCMMusicPlayer() {
|
||||
|
||||
_vm->_mixer->playStream(Audio::Mixer::kMusicSoundType,
|
||||
&_handle, this, -1, _volume, 0, DisposeAfterUse::NO, true);
|
||||
|
||||
if (TinselVersion == 3) {
|
||||
warning("Todo: remove workaround when deadlock in readBuffer is fixed");
|
||||
}
|
||||
}
|
||||
|
||||
PCMMusicPlayer::~PCMMusicPlayer() {
|
||||
@ -726,6 +730,10 @@ void PCMMusicPlayer::stopPlay() {
|
||||
int PCMMusicPlayer::readBuffer(int16 *buffer, const int numSamples) {
|
||||
Common::StackLock slock(_mutex);
|
||||
|
||||
// Workaround for v3 to prevent deadlock due to missing chunk
|
||||
if ((TinselVersion == 3) && !_curChunk && _state == S_MID)
|
||||
return 0;
|
||||
|
||||
if (!_curChunk && ((_state == S_IDLE) || (_state == S_STOP)))
|
||||
return 0;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user