Commit 9d3a0ab4 authored by sletz's avatar sletz
Browse files

Correct RenderFromNetwork.

git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@4490 0c269be4-1314-0410-8aa9-9f06e86f4224
parent b1185fcc
......@@ -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
......
......@@ -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) {
......
......@@ -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,
......
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