Commit 6bc958ef authored by Stephane Letz's avatar Stephane Letz
Browse files

Correct NetIntAudioBuffer.

parent c2e0ca73
......@@ -844,6 +844,8 @@ struct JackNetExtSlave : public JackNetSlaveInterface, public JackRunnableInterf
return SOCKET_ERROR;
}
if (fFrames < 0) fFrames = fParams.fPeriodSize;
fProcessCallback(fFrames,
fParams.fSendAudioChannels,
fAudioCaptureBuffer,
......
......@@ -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++) {
......
......@@ -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;
......
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