diff --git a/common/JackNetTool.h b/common/JackNetTool.h index 238b075a..ac5b61b8 100644 --- a/common/JackNetTool.h +++ b/common/JackNetTool.h @@ -534,6 +534,14 @@ namespace Jack //network<->buffer virtual void RenderFromNetwork(char* net_buffer, int cycle, int sub_cycle, size_t copy_size, uint32_t port_num) { + // Cleanup all JACK ports at the beginning of the cycle + if (sub_cycle == 0) { + for (int port_index = 0; port_index < fNPorts; port_index++) { + if (fPortBuffer[port_index]) + memset(fPortBuffer[port_index], 0, fPeriodSize * sizeof(sample_t)); + } + } + if (port_num > 0) { /// Setup rendering parameters @@ -546,12 +554,7 @@ namespace Jack } sub_period_bytes_size = sub_period_size * sizeof(sample_t) + sizeof(uint32_t); // The port number in coded on 4 bytes - if (sub_cycle == 0) { // Cleanup all JACK ports - for (int port_index = 0; port_index < fNPorts; port_index++) { - if (fPortBuffer[port_index]) - memset(fPortBuffer[port_index], 0, fPeriodSize * sizeof(sample_t)); - } - } + for (uint32_t port_index = 0; port_index < port_num; port_index++) { // Only copy to active ports : read the active port number then audio data diff --git a/common/Jackdmp.cpp b/common/Jackdmp.cpp index 329cfeae..b43cd51f 100644 --- a/common/Jackdmp.cpp +++ b/common/Jackdmp.cpp @@ -526,6 +526,7 @@ int main(int argc, char* argv[]) if (! jackctl_server_stop(server_ctl)) { fprintf(stderr, "Cannot stop server...\n"); } + close_server: if (loopback > 0 && loopback_driver_ctl) { jackctl_server_remove_slave(server_ctl, loopback_driver_ctl); @@ -544,6 +545,7 @@ int main(int argc, char* argv[]) jackctl_server_unload_internal(server_ctl, internal_driver_ctl); } jackctl_server_close(server_ctl); + destroy_server: jackctl_server_destroy(server_ctl); if (notify_sent) { diff --git a/macosx/coreaudio/JackCoreAudioDriver.h b/macosx/coreaudio/JackCoreAudioDriver.h index 5f91f94b..8f50d597 100644 --- a/macosx/coreaudio/JackCoreAudioDriver.h +++ b/macosx/coreaudio/JackCoreAudioDriver.h @@ -76,13 +76,7 @@ class JackCoreAudioDriver : public JackAudioDriver float fComputationGrain; bool fClockDriftCompensate; - /* - #ifdef MAC_OS_X_VERSION_10_5 - AudioDeviceIOProcID fMesureCallbackID; - #endif - */ - - static OSStatus Render(void *inRefCon, + static OSStatus Render(void *inRefCon, AudioUnitRenderActionFlags *ioActionFlags, const AudioTimeStamp *inTimeStamp, UInt32 inBusNumber, @@ -90,17 +84,17 @@ class JackCoreAudioDriver : public JackAudioDriver AudioBufferList *ioData); static OSStatus DeviceNotificationCallback(AudioDeviceID inDevice, - UInt32 inChannel, - Boolean isInput, - AudioDevicePropertyID inPropertyID, - void* inClientData); + UInt32 inChannel, + Boolean isInput, + AudioDevicePropertyID inPropertyID, + void* inClientData); static OSStatus SRNotificationCallback(AudioDeviceID inDevice, UInt32 inChannel, Boolean isInput, AudioDevicePropertyID inPropertyID, void* inClientData); - + static OSStatus BSNotificationCallback(AudioDeviceID inDevice, UInt32 inChannel, Boolean isInput,