git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@4490 0c269be4-1314-0410-8aa9-9f06e86f4224tags/1.9.8
| @@ -534,6 +534,14 @@ namespace Jack | |||||
| //network<->buffer | //network<->buffer | ||||
| virtual void RenderFromNetwork(char* net_buffer, int cycle, int sub_cycle, size_t copy_size, uint32_t port_num) | 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) { | if (port_num > 0) { | ||||
| /// Setup rendering parameters | /// 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 | 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++) { | 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 | // Only copy to active ports : read the active port number then audio data | ||||
| @@ -526,6 +526,7 @@ int main(int argc, char* argv[]) | |||||
| if (! jackctl_server_stop(server_ctl)) { | if (! jackctl_server_stop(server_ctl)) { | ||||
| fprintf(stderr, "Cannot stop server...\n"); | fprintf(stderr, "Cannot stop server...\n"); | ||||
| } | } | ||||
| close_server: | close_server: | ||||
| if (loopback > 0 && loopback_driver_ctl) { | if (loopback > 0 && loopback_driver_ctl) { | ||||
| jackctl_server_remove_slave(server_ctl, 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_unload_internal(server_ctl, internal_driver_ctl); | ||||
| } | } | ||||
| jackctl_server_close(server_ctl); | jackctl_server_close(server_ctl); | ||||
| destroy_server: | destroy_server: | ||||
| jackctl_server_destroy(server_ctl); | jackctl_server_destroy(server_ctl); | ||||
| if (notify_sent) { | if (notify_sent) { | ||||
| @@ -76,13 +76,7 @@ class JackCoreAudioDriver : public JackAudioDriver | |||||
| float fComputationGrain; | float fComputationGrain; | ||||
| bool fClockDriftCompensate; | bool fClockDriftCompensate; | ||||
| /* | |||||
| #ifdef MAC_OS_X_VERSION_10_5 | |||||
| AudioDeviceIOProcID fMesureCallbackID; | |||||
| #endif | |||||
| */ | |||||
| static OSStatus Render(void *inRefCon, | |||||
| static OSStatus Render(void *inRefCon, | |||||
| AudioUnitRenderActionFlags *ioActionFlags, | AudioUnitRenderActionFlags *ioActionFlags, | ||||
| const AudioTimeStamp *inTimeStamp, | const AudioTimeStamp *inTimeStamp, | ||||
| UInt32 inBusNumber, | UInt32 inBusNumber, | ||||
| @@ -90,17 +84,17 @@ class JackCoreAudioDriver : public JackAudioDriver | |||||
| AudioBufferList *ioData); | AudioBufferList *ioData); | ||||
| static OSStatus DeviceNotificationCallback(AudioDeviceID inDevice, | 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, | static OSStatus SRNotificationCallback(AudioDeviceID inDevice, | ||||
| UInt32 inChannel, | UInt32 inChannel, | ||||
| Boolean isInput, | Boolean isInput, | ||||
| AudioDevicePropertyID inPropertyID, | AudioDevicePropertyID inPropertyID, | ||||
| void* inClientData); | void* inClientData); | ||||
| static OSStatus BSNotificationCallback(AudioDeviceID inDevice, | static OSStatus BSNotificationCallback(AudioDeviceID inDevice, | ||||
| UInt32 inChannel, | UInt32 inChannel, | ||||
| Boolean isInput, | Boolean isInput, | ||||