Browse Source

Correct NetIntAudioBuffer.

tags/v1.9.10
Stephane Letz 12 years ago
parent
commit
6bc958ef4a
3 changed files with 9 additions and 7 deletions
  1. +2
    -0
      common/JackNetAPI.cpp
  2. +6
    -6
      common/JackNetTool.cpp
  3. +1
    -1
      common/JackNetTool.h

+ 2
- 0
common/JackNetAPI.cpp View File

@@ -844,6 +844,8 @@ struct JackNetExtSlave : public JackNetSlaveInterface, public JackRunnableInterf
return SOCKET_ERROR;
}
if (fFrames < 0) fFrames = fParams.fPeriodSize;
fProcessCallback(fFrames,
fParams.fSendAudioChannels,
fAudioCaptureBuffer,


+ 6
- 6
common/JackNetTool.cpp View File

@@ -996,23 +996,23 @@ namespace Jack
int NetIntAudioBuffer::RenderFromJackPorts()
{
// Count active ports
int active_ports = 0;
for (int port_index = 0; port_index < fNPorts; port_index++) {
if (fPortBuffer[port_index]) {
for (uint frame = 0; frame < fPeriodSize; frame++) {
fIntBuffer[port_index][frame] = short(fPortBuffer[port_index][frame] * 32768.f);
fIntBuffer[port_index][frame] = short(fPortBuffer[port_index][frame] * 32767.f);
}
active_ports++;
} else {
memset(fIntBuffer[port_index], 0, fPeriodSize * sizeof(short));
}
}
return active_ports;
// All ports active
return fNPorts;
}

void NetIntAudioBuffer::RenderToJackPorts()
{
float coef = 1.f / 32768.f;
float coef = 1.f / 32767.f;
for (int port_index = 0; port_index < fNPorts; port_index++) {
if (fPortBuffer[port_index]) {
for (uint frame = 0; frame < fPeriodSize; frame++) {


+ 1
- 1
common/JackNetTool.h View File

@@ -180,7 +180,7 @@ namespace Jack
uint32_t fActivePorts; //number of active ports
uint32_t fCycle; //process cycle counter
uint32_t fSubCycle; //midi/audio subcycle counter
uint32_t fFrames; //process cycle size in frames
int32_t fFrames; //process cycle size in frames (can be -1 to indicate entire buffer)
uint32_t fIsLastPckt; //is it the last packet of a given cycle ('y' or 'n')
} POST_PACKED_STRUCTURE;



Loading…
Cancel
Save