Commit d03fd1e8 authored by sletz's avatar sletz
Browse files

Cleanup.

git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@4764 0c269be4-1314-0410-8aa9-9f06e86f4224
parent 1acc1db9
......@@ -585,19 +585,22 @@ inline void JackClient::ExecuteThread()
inline jack_nframes_t JackClient::CycleWaitAux()
{
if (!WaitSync())
if (!WaitSync()) {
Error(); // Terminates the thread
}
CallSyncCallbackAux();
return GetEngineControl()->fBufferSize;
}
inline void JackClient::CycleSignalAux(int status)
{
if (status == 0)
if (status == 0) {
CallTimebaseCallbackAux();
}
SignalSync();
if (status != 0)
if (status != 0) {
End(); // Terminates the thread
}
}
jack_nframes_t JackClient::CycleWait()
......@@ -784,8 +787,9 @@ inline int JackClient::ActivateAux()
jack_log("JackClient::ActivateAux");
// RT thread is started
if (StartThread() < 0)
if (StartThread() < 0) {
return -1;
}
int result = -1;
GetClientControl()->fCallback[kRealTimeCallback] = IsRealTime();
......@@ -1045,8 +1049,9 @@ int JackClient::SetSampleRateCallback(JackSampleRateCallback callback, void *arg
fSampleRateArg = arg;
fSampleRate = callback;
// Now invoke it
if (callback)
if (callback) {
callback(GetEngineControl()->fSampleRate, arg);
}
return 0;
}
}
......@@ -1125,7 +1130,7 @@ int JackClient::SetProcessThread(JackThreadCallback fun, void *arg)
jack_error("You cannot set callbacks on an active client");
return -1;
} 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;
} else {
fThreadFun = fun;
......
......@@ -696,10 +696,8 @@ error:
int JackEngine::ClientExternalClose(int refnum)
{
jack_log("JackEngine::ClientExternalClose ref = %ld", refnum);
JackClientInterface* client = fClientTable[refnum];
fEngineControl->fTransport.ResetTimebase(refnum);
int res = ClientCloseAux(refnum, client, true);
int res = ClientCloseAux(refnum, true);
client->Close();
delete client;
return res;
......@@ -709,15 +707,15 @@ int JackEngine::ClientExternalClose(int refnum)
int JackEngine::ClientInternalClose(int refnum, bool wait)
{
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);
JackClientInterface* client = fClientTable[refnum];
fEngineControl->fTransport.ResetTimebase(refnum);
// Unregister all ports ==> notifications are sent
jack_int_t ports[PORT_NUM_FOR_CLIENT];
......
......@@ -61,7 +61,7 @@ class SERVER_EXPORT JackEngine : public JackLockAble
std::map<int,std::string> fReservationMap;
int fMaxUUID;
int ClientCloseAux(int refnum, JackClientInterface* client, bool wait);
int ClientCloseAux(int refnum, bool wait);
void CheckXRun(jack_time_t callback_usecs);
int NotifyAddClient(JackClientInterface* new_client, const char* new_name, int refnum);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment