Commit f7d0f8ee authored by Stephane Letz's avatar Stephane Letz
Browse files

InSynched not really needed in NetJack2.

parent 0faa7744
......@@ -454,22 +454,16 @@ struct JackNetExtMaster : public JackNetMasterInterface {
fNetMidiCaptureBuffer->SetBuffer(midi_port_index, ((JackMidiBuffer**)midi_output_buffer)[midi_port_index]);
}
if (IsSynched()) { // only send if connection is "synched"
EncodeSyncPacket();
EncodeSyncPacket();
// send sync
if (SyncSend() == SOCKET_ERROR) {
return SOCKET_ERROR;
}
// send sync
if (SyncSend() == SOCKET_ERROR) {
return SOCKET_ERROR;
}
//send data
if (DataSend() == SOCKET_ERROR) {
return SOCKET_ERROR;
}
} else {
jack_info("Connection is not synched, skip cycle...");
//send data
if (DataSend() == SOCKET_ERROR) {
return SOCKET_ERROR;
}
return 0;
......
......@@ -445,11 +445,6 @@ namespace Jack
return tx_bytes;
}
bool JackNetMasterInterface::IsSynched()
{
return (fCurrentCycleOffset <= fMaxCycleOffset);
}
int JackNetMasterInterface::SyncSend()
{
SetRcvTimeOut();
......
......@@ -156,8 +156,6 @@ namespace Jack
int Send(size_t size, int flags);
int Recv(size_t size, int flags);
bool IsSynched();
void FatalRecvError();
void FatalSendError();
......
......@@ -495,32 +495,26 @@ namespace Jack
#endif
}
if (IsSynched()) { // only send if connection is "synched"
//encode the first packet
EncodeSyncPacket();
//encode the first packet
EncodeSyncPacket();
if (SyncSend() == SOCKET_ERROR) {
return SOCKET_ERROR;
}
#ifdef JACK_MONITOR
fNetTimeMon->Add((((float)(GetMicroSeconds() - begin_time)) / (float) fPeriodUsecs) * 100.f);
#endif
//send data
if (DataSend() == SOCKET_ERROR) {
return SOCKET_ERROR;
}
if (SyncSend() == SOCKET_ERROR) {
return SOCKET_ERROR;
}
#ifdef JACK_MONITOR
fNetTimeMon->Add((((float)(GetMicroSeconds() - begin_time)) / (float) fPeriodUsecs) * 100.f);
#endif
#ifdef JACK_MONITOR
fNetTimeMon->Add((((float)(GetMicroSeconds() - begin_time)) / (float) fPeriodUsecs) * 100.f);
#endif
} else {
jack_info("Connection is not synched, skip cycle...");
//send data
if (DataSend() == SOCKET_ERROR) {
return SOCKET_ERROR;
}
#ifdef JACK_MONITOR
fNetTimeMon->Add((((float)(GetMicroSeconds() - begin_time)) / (float) fPeriodUsecs) * 100.f);
#endif
//receive sync
int res = SyncRecv();
switch (res) {
......
......@@ -738,13 +738,12 @@ namespace Jack
for (int i = 0; i < fNPorts; i++) {
/* Allocate en/decoders */
fOpusMode[i] = opus_custom_mode_create(
params->fSampleRate, params->fPeriodSize, &error);
fOpusMode[i] = opus_custom_mode_create(params->fSampleRate, params->fPeriodSize, &error);
if (error != OPUS_OK) {
goto error;
}
fOpusEncoder[i] = opus_custom_encoder_create(fOpusMode[i], 1,&error);
fOpusEncoder[i] = opus_custom_encoder_create(fOpusMode[i], 1, &error);
if (error != OPUS_OK) {
goto error;
}
......
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