Browse Source

Fix crash when audio engine stops responding

tags/1.9.8
Filipe Coelho 6 years ago
parent
commit
b4061e6933
2 changed files with 23 additions and 1 deletions
  1. +1
    -1
      source/backend/engine/CarlaEngine.cpp
  2. +22
    -0
      source/backend/engine/CarlaEngineInternal.cpp

+ 1
- 1
source/backend/engine/CarlaEngine.cpp View File

@@ -264,7 +264,7 @@ bool CarlaEngine::usesConstantBufferSize() const noexcept


void CarlaEngine::idle() noexcept void CarlaEngine::idle() noexcept
{ {
CARLA_SAFE_ASSERT_RETURN(pData->nextAction.opcode == kEnginePostActionNull,); // FIXME REMOVE
CARLA_SAFE_ASSERT_RETURN(pData->nextAction.opcode == kEnginePostActionNull,);
CARLA_SAFE_ASSERT_RETURN(pData->nextPluginId == pData->maxPluginNumber,); CARLA_SAFE_ASSERT_RETURN(pData->nextPluginId == pData->maxPluginNumber,);
CARLA_SAFE_ASSERT_RETURN(getType() != kEngineTypePlugin,); CARLA_SAFE_ASSERT_RETURN(getType() != kEngineTypePlugin,);




+ 22
- 0
source/backend/engine/CarlaEngineInternal.cpp View File

@@ -720,6 +720,28 @@ ScopedActionLock::ScopedActionLock(CarlaEngine* const engine, const EnginePostAc
carla_sem_timedwait(*pData->nextAction.sem, 2000); carla_sem_timedwait(*pData->nextAction.sem, 2000);


carla_stdout("ScopedPluginAction(%i) - blocking DONE", pluginId); carla_stdout("ScopedPluginAction(%i) - blocking DONE", pluginId);

// check if anything went wrong...
if (! pData->nextAction.postDone)
{
bool needsCorrection = false;

{
const CarlaMutexLocker cml(pData->nextAction.mutex);

if (pData->nextAction.opcode != kEnginePostActionNull)
{
needsCorrection = true;
pData->nextAction.needsPost = false;
}
}

if (needsCorrection)
{
pData->doNextPluginAction();
carla_stderr2("Failed to wait for engine, is audio not running?");
}
}
} }
else else
{ {


Loading…
Cancel
Save