Browse Source

Fix hang when initializing Audio module.

tags/v2.0.4
Andrew Belt 2 years ago
parent
commit
2e4580112e
2 changed files with 5 additions and 2 deletions
  1. +1
    -1
      include/engine/Engine.hpp
  2. +4
    -1
      src/core/Audio.cpp

+ 1
- 1
include/engine/Engine.hpp View File

@@ -42,7 +42,7 @@ struct Engine {
Write-locks.
*/
void setMasterModule(Module* module);
PRIVATE void setMasterModule_NoLock(Module* module);
void setMasterModule_NoLock(Module* module);
Module* getMasterModule();

/** Returns the sample rate used by the engine for stepping each module.


+ 4
- 1
src/core/Audio.cpp View File

@@ -174,7 +174,10 @@ struct AudioPort : audio::Port {
deviceSampleRate = 0.f;
engineInputBuffer.clear();
engineOutputBuffer.clear();
setMaster(false);
// We can be in an Engine write-lock here (e.g. onReset() calls this indirectly), so use non-locking master module API.
// setMaster(false);
if (APP->engine->getMasterModule() == module)
APP->engine->setMasterModule_NoLock(NULL);
// DEBUG("onStopStream");
}
};


Loading…
Cancel
Save