Browse Source

libjack: fix for clients registering too early

tags/v1.9.12
falkTX 6 years ago
parent
commit
89416523d1
1 changed files with 15 additions and 7 deletions
  1. +15
    -7
      source/libjack/libjack.cpp

+ 15
- 7
source/libjack/libjack.cpp View File

@@ -120,6 +120,7 @@ public:
fMidiInBuffers(nullptr),
fMidiOutBuffers(nullptr),
fIsOffline(false),
fIsReady(false),
fLastPingTime(-1),
fSessionManager(0),
fSetupHints(0),
@@ -194,6 +195,9 @@ public:

JackClientState* createClient(const char* const name)
{
while (fNonRealtimeThread.isThreadRunning() && ! fIsReady)
carla_sleep(1);

return new JackClientState(fServer, name);
}

@@ -285,6 +289,7 @@ private:
char fBaseNameNonRtServerControl[6+1];

bool fIsOffline;
volatile bool fIsReady;
int64_t fLastPingTime;

int fSessionManager;
@@ -390,17 +395,20 @@ bool CarlaJackAppClient::initSharedMemmory()
fAudioTmpBuf = new float[fServer.bufferSize];
carla_zeroFloats(fAudioTmpBuf, fServer.bufferSize);

// tell backend we're live
const CarlaMutexLocker _cml(fShmNonRtServerControl.mutex);

fLastPingTime = getCurrentTimeMilliseconds();
CARLA_SAFE_ASSERT(fLastPingTime > 0);

// ready!
fShmNonRtServerControl.writeOpcode(kPluginBridgeNonRtServerReady);
fShmNonRtServerControl.commitWrite();
fShmNonRtServerControl.waitIfDataIsReachingLimit();
{
// tell backend we're live
const CarlaMutexLocker _cml(fShmNonRtServerControl.mutex);

// ready!
fShmNonRtServerControl.writeOpcode(kPluginBridgeNonRtServerReady);
fShmNonRtServerControl.commitWrite();
fShmNonRtServerControl.waitIfDataIsReachingLimit();
}

fIsReady = true;
return true;
}



Loading…
Cancel
Save