diff options
-rw-r--r-- | common/JackAudioDriver.cpp | 3 | ||||
-rw-r--r-- | common/JackEngineControl.cpp | 12 | ||||
-rw-r--r-- | common/JackNetAPI.cpp | 2 | ||||
-rw-r--r-- | common/JackNetInterface.cpp | 4 | ||||
-rw-r--r-- | common/JackNetManager.cpp | 4 | ||||
-rw-r--r-- | common/JackNetTool.h | 3 | ||||
-rw-r--r-- | macosx/JackMachTime.c | 4 |
7 files changed, 17 insertions, 15 deletions
diff --git a/common/JackAudioDriver.cpp b/common/JackAudioDriver.cpp index 3cb0f56f..4bb8778b 100644 --- a/common/JackAudioDriver.cpp +++ b/common/JackAudioDriver.cpp @@ -209,8 +209,9 @@ int JackAudioDriver::Write() jack_default_audio_sample_t* buffer = GetOutputBuffer(i); int size = sizeof(jack_default_audio_sample_t) * fEngineControl->fBufferSize; // Monitor ports - if (fWithMonitorPorts && fGraphManager->GetConnectionsNum(fMonitorPortList[i]) > 0) + if (fWithMonitorPorts && fGraphManager->GetConnectionsNum(fMonitorPortList[i]) > 0) { memcpy(GetMonitorBuffer(i), buffer, size); + } } } return 0; diff --git a/common/JackEngineControl.cpp b/common/JackEngineControl.cpp index f757cd88..56b3bdea 100644 --- a/common/JackEngineControl.cpp +++ b/common/JackEngineControl.cpp @@ -47,16 +47,19 @@ void JackEngineControl::CalcCPULoad(JackClientInterface** table, for (int i = fDriverNum; i < CLIENT_NUM; i++) { JackClientInterface* client = table[i]; JackClientTiming* timing = manager->GetClientTiming(i); - if (client && client->GetClientControl()->fActive && timing->fStatus == Finished) + if (client && client->GetClientControl()->fActive && timing->fStatus == Finished) { last_cycle_end = JACK_MAX(last_cycle_end, timing->fFinishedAt); + } } } // Store the execution time for later averaging - if (last_cycle_end > 0) + if (last_cycle_end > 0) { fRollingClientUsecs[fRollingClientUsecsIndex++] = last_cycle_end - fPrevCycleTime; - if (fRollingClientUsecsIndex >= JACK_ENGINE_ROLLING_COUNT) + } + if (fRollingClientUsecsIndex >= JACK_ENGINE_ROLLING_COUNT) { fRollingClientUsecsIndex = 0; + } // Each time we have a full set of iterations, recompute the current // usage from the latest JACK_ENGINE_ROLLING_COUNT client entries. @@ -65,8 +68,7 @@ void JackEngineControl::CalcCPULoad(JackClientInterface** table, jack_time_t max_usecs = 0; for (int i = 0; i < JACK_ENGINE_ROLLING_COUNT; i++) { - avg_usecs += fRollingClientUsecs[i]; // This is really a running - // total to be averaged later + avg_usecs += fRollingClientUsecs[i]; // This is really a running total to be averaged later max_usecs = JACK_MAX(fRollingClientUsecs[i], max_usecs); } diff --git a/common/JackNetAPI.cpp b/common/JackNetAPI.cpp index 443240bd..acc2c152 100644 --- a/common/JackNetAPI.cpp +++ b/common/JackNetAPI.cpp @@ -263,7 +263,7 @@ struct JackNetExtMaster : public JackNetMasterInterface { int InitMaster(jack_slave_t* result) { // Check MASTER <==> SLAVE network protocol coherency - if (fParams.fProtocolVersion != MASTER_PROTOCOL) { + if (fParams.fProtocolVersion != NETWORK_PROTOCOL) { jack_error("Error : slave is running with a different protocol %s", fParams.fName); return -1; } diff --git a/common/JackNetInterface.cpp b/common/JackNetInterface.cpp index 901da5f9..f20e659a 100644 --- a/common/JackNetInterface.cpp +++ b/common/JackNetInterface.cpp @@ -612,7 +612,7 @@ namespace Jack // set the parameters to send strcpy(fParams.fPacketType, "params"); - fParams.fProtocolVersion = SLAVE_PROTOCOL; + fParams.fProtocolVersion = NETWORK_PROTOCOL; SetPacketType(&fParams, SLAVE_AVAILABLE); // init loop : get a master and start, do it until connection is ok @@ -647,7 +647,7 @@ namespace Jack // set the parameters to send strcpy(fParams.fPacketType, "params"); - fParams.fProtocolVersion = SLAVE_PROTOCOL; + fParams.fProtocolVersion = NETWORK_PROTOCOL; SetPacketType(&fParams, SLAVE_AVAILABLE); net_status_t status; diff --git a/common/JackNetManager.cpp b/common/JackNetManager.cpp index 38a444a5..df113f9b 100644 --- a/common/JackNetManager.cpp +++ b/common/JackNetManager.cpp @@ -841,8 +841,8 @@ namespace Jack jack_log("JackNetMasterManager::InitMaster slave : %s", params.fName); //check MASTER <<==> SLAVE network protocol coherency - if (params.fProtocolVersion != MASTER_PROTOCOL) { - jack_error("Error : slave %s is running with a different protocol %d != %d", params.fName, params.fProtocolVersion, MASTER_PROTOCOL); + if (params.fProtocolVersion != NETWORK_PROTOCOL) { + jack_error("Error : slave %s is running with a different protocol %d != %d", params.fName, params.fProtocolVersion, NETWORK_PROTOCOL); return NULL; } diff --git a/common/JackNetTool.h b/common/JackNetTool.h index 8e5e2bc1..8ec9de2c 100644 --- a/common/JackNetTool.h +++ b/common/JackNetTool.h @@ -38,8 +38,7 @@ using namespace std; #endif #endif -#define MASTER_PROTOCOL 6 -#define SLAVE_PROTOCOL 6 +#define NETWORK_PROTOCOL 6 #define NET_SYNCHING 0 #define NET_PACKET_ERROR -2 diff --git a/macosx/JackMachTime.c b/macosx/JackMachTime.c index 70ec8edd..c9995aa7 100644 --- a/macosx/JackMachTime.c +++ b/macosx/JackMachTime.c @@ -36,7 +36,7 @@ SERVER_EXPORT void InitTime() { mach_timebase_info_data_t info; mach_timebase_info(&info); - __jack_time_ratio = ((float)info.numer / info.denom) / 1000; + __jack_time_ratio = ((double)info.numer / (double)info.denom) / 1000; } SERVER_EXPORT void EndTime() @@ -44,7 +44,7 @@ SERVER_EXPORT void EndTime() SERVER_EXPORT jack_time_t GetMicroSeconds(void) { - return (jack_time_t) (mach_absolute_time () * __jack_time_ratio); + return (jack_time_t) (mach_absolute_time() * __jack_time_ratio); } void SetClockSource(jack_timer_type_t source) |