Browse Source

Correct RenderFromNetwork.

git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@4490 0c269be4-1314-0410-8aa9-9f06e86f4224
tags/1.9.8
sletz 14 years ago
parent
commit
9d3a0ab4d4
3 changed files with 17 additions and 18 deletions
  1. +9
    -6
      common/JackNetTool.h
  2. +2
    -0
      common/Jackdmp.cpp
  3. +6
    -12
      macosx/coreaudio/JackCoreAudioDriver.h

+ 9
- 6
common/JackNetTool.h View File

@@ -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


+ 2
- 0
common/Jackdmp.cpp View File

@@ -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) {


+ 6
- 12
macosx/coreaudio/JackCoreAudioDriver.h View File

@@ -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,


Loading…
Cancel
Save