git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@4764 0c269be4-1314-0410-8aa9-9f06e86f4224tags/1.9.9.5
@@ -585,19 +585,22 @@ inline void JackClient::ExecuteThread() | |||||
inline jack_nframes_t JackClient::CycleWaitAux() | inline jack_nframes_t JackClient::CycleWaitAux() | ||||
{ | { | ||||
if (!WaitSync()) | |||||
if (!WaitSync()) { | |||||
Error(); // Terminates the thread | Error(); // Terminates the thread | ||||
} | |||||
CallSyncCallbackAux(); | CallSyncCallbackAux(); | ||||
return GetEngineControl()->fBufferSize; | return GetEngineControl()->fBufferSize; | ||||
} | } | ||||
inline void JackClient::CycleSignalAux(int status) | inline void JackClient::CycleSignalAux(int status) | ||||
{ | { | ||||
if (status == 0) | |||||
if (status == 0) { | |||||
CallTimebaseCallbackAux(); | CallTimebaseCallbackAux(); | ||||
} | |||||
SignalSync(); | SignalSync(); | ||||
if (status != 0) | |||||
if (status != 0) { | |||||
End(); // Terminates the thread | End(); // Terminates the thread | ||||
} | |||||
} | } | ||||
jack_nframes_t JackClient::CycleWait() | jack_nframes_t JackClient::CycleWait() | ||||
@@ -784,8 +787,9 @@ inline int JackClient::ActivateAux() | |||||
jack_log("JackClient::ActivateAux"); | jack_log("JackClient::ActivateAux"); | ||||
// RT thread is started | // RT thread is started | ||||
if (StartThread() < 0) | |||||
if (StartThread() < 0) { | |||||
return -1; | return -1; | ||||
} | |||||
int result = -1; | int result = -1; | ||||
GetClientControl()->fCallback[kRealTimeCallback] = IsRealTime(); | GetClientControl()->fCallback[kRealTimeCallback] = IsRealTime(); | ||||
@@ -1045,8 +1049,9 @@ int JackClient::SetSampleRateCallback(JackSampleRateCallback callback, void *arg | |||||
fSampleRateArg = arg; | fSampleRateArg = arg; | ||||
fSampleRate = callback; | fSampleRate = callback; | ||||
// Now invoke it | // Now invoke it | ||||
if (callback) | |||||
if (callback) { | |||||
callback(GetEngineControl()->fSampleRate, arg); | callback(GetEngineControl()->fSampleRate, arg); | ||||
} | |||||
return 0; | return 0; | ||||
} | } | ||||
} | } | ||||
@@ -1125,7 +1130,7 @@ int JackClient::SetProcessThread(JackThreadCallback fun, void *arg) | |||||
jack_error("You cannot set callbacks on an active client"); | jack_error("You cannot set callbacks on an active client"); | ||||
return -1; | return -1; | ||||
} else if (fProcess) { | } else if (fProcess) { | ||||
jack_error ("A process callback has already been setup, both models cannot be used at the same time!"); | |||||
jack_error("A process callback has already been setup, both models cannot be used at the same time!"); | |||||
return -1; | return -1; | ||||
} else { | } else { | ||||
fThreadFun = fun; | fThreadFun = fun; | ||||
@@ -696,10 +696,8 @@ error: | |||||
int JackEngine::ClientExternalClose(int refnum) | int JackEngine::ClientExternalClose(int refnum) | ||||
{ | { | ||||
jack_log("JackEngine::ClientExternalClose ref = %ld", refnum); | jack_log("JackEngine::ClientExternalClose ref = %ld", refnum); | ||||
JackClientInterface* client = fClientTable[refnum]; | JackClientInterface* client = fClientTable[refnum]; | ||||
fEngineControl->fTransport.ResetTimebase(refnum); | |||||
int res = ClientCloseAux(refnum, client, true); | |||||
int res = ClientCloseAux(refnum, true); | |||||
client->Close(); | client->Close(); | ||||
delete client; | delete client; | ||||
return res; | return res; | ||||
@@ -709,15 +707,15 @@ int JackEngine::ClientExternalClose(int refnum) | |||||
int JackEngine::ClientInternalClose(int refnum, bool wait) | int JackEngine::ClientInternalClose(int refnum, bool wait) | ||||
{ | { | ||||
jack_log("JackEngine::ClientInternalClose ref = %ld", refnum); | jack_log("JackEngine::ClientInternalClose ref = %ld", refnum); | ||||
JackClientInterface* client = fClientTable[refnum]; | |||||
fEngineControl->fTransport.ResetTimebase(refnum); | |||||
return ClientCloseAux(refnum, client, wait); | |||||
return ClientCloseAux(refnum, wait); | |||||
} | } | ||||
int JackEngine::ClientCloseAux(int refnum, JackClientInterface* client, bool wait) | |||||
int JackEngine::ClientCloseAux(int refnum, bool wait) | |||||
{ | { | ||||
jack_log("JackEngine::ClientCloseAux ref = %ld", refnum); | jack_log("JackEngine::ClientCloseAux ref = %ld", refnum); | ||||
JackClientInterface* client = fClientTable[refnum]; | |||||
fEngineControl->fTransport.ResetTimebase(refnum); | |||||
// Unregister all ports ==> notifications are sent | // Unregister all ports ==> notifications are sent | ||||
jack_int_t ports[PORT_NUM_FOR_CLIENT]; | jack_int_t ports[PORT_NUM_FOR_CLIENT]; | ||||
@@ -61,7 +61,7 @@ class SERVER_EXPORT JackEngine : public JackLockAble | |||||
std::map<int,std::string> fReservationMap; | std::map<int,std::string> fReservationMap; | ||||
int fMaxUUID; | int fMaxUUID; | ||||
int ClientCloseAux(int refnum, JackClientInterface* client, bool wait); | |||||
int ClientCloseAux(int refnum, bool wait); | |||||
void CheckXRun(jack_time_t callback_usecs); | void CheckXRun(jack_time_t callback_usecs); | ||||
int NotifyAddClient(JackClientInterface* new_client, const char* new_name, int refnum); | int NotifyAddClient(JackClientInterface* new_client, const char* new_name, int refnum); | ||||