From 2199a24c9c76ed96972fce290963409d06f21735 Mon Sep 17 00:00:00 2001 From: sletz Date: Wed, 25 Jan 2012 08:56:43 +0000 Subject: [PATCH] Fix NetJack2 initialisation bug. git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@4733 0c269be4-1314-0410-8aa9-9f06e86f4224 --- ChangeLog | 6 +++++- common/JackNetInterface.h | 8 +++---- common/JackNetManager.cpp | 44 +-------------------------------------- 3 files changed, 9 insertions(+), 49 deletions(-) diff --git a/ChangeLog b/ChangeLog index b2ebbf4c..feaecc88 100644 --- a/ChangeLog +++ b/ChangeLog @@ -36,9 +36,13 @@ John Emmas Jackdmp changes log --------------------------- +2012-01-25 Stephane Letz + + * Fix NetJack2 initialisation bug. + 2012-01-24 Stephane Letz - * Improve ShutDown in NetManager + * Improve ShutDown in NetManager. * Correct ShutDown in JackInternalClient and JackLibClient. 2012-01-20 Stephane Letz diff --git a/common/JackNetInterface.h b/common/JackNetInterface.h index c40e737a..b20a4b89 100644 --- a/common/JackNetInterface.h +++ b/common/JackNetInterface.h @@ -135,11 +135,9 @@ namespace Jack protected: bool fRunning; - int fCurrentCycleOffset; int fMaxCycleOffset; - int fLastfCycleOffset; - + bool Init(); bool SetParams(); @@ -165,10 +163,10 @@ namespace Jack public: - JackNetMasterInterface() : JackNetInterface(), fRunning(false), fCurrentCycleOffset(0), fMaxCycleOffset(0), fLastfCycleOffset(0) + JackNetMasterInterface() : JackNetInterface(), fRunning(false), fCurrentCycleOffset(0), fMaxCycleOffset(0) {} JackNetMasterInterface(session_params_t& params, JackNetSocket& socket, const char* multicast_ip) - : JackNetInterface(params, socket, multicast_ip) + : JackNetInterface(params, socket, multicast_ip), fRunning(false), fCurrentCycleOffset(0), fMaxCycleOffset(0) {} virtual~JackNetMasterInterface() diff --git a/common/JackNetManager.cpp b/common/JackNetManager.cpp index 3d39a102..ff15d9c5 100644 --- a/common/JackNetManager.cpp +++ b/common/JackNetManager.cpp @@ -390,8 +390,6 @@ namespace Jack int JackNetMaster::Process() { - int res; - if (!fRunning) { return 0; } @@ -478,31 +476,11 @@ namespace Jack } //receive sync - res = SyncRecv(); + int res = SyncRecv(); if ((res == 0) || (res == SOCKET_ERROR)) { return res; } - /* - switch (SyncRecv()) { - - case 0: - jack_error("Connection is not yet synched, skip cycle..."); - return 0; - - case SOCKET_ERROR: - jack_error("Connection is lost, quit master..."); - //ask to the manager to properly remove the master - Exit(); - //UGLY temporary way to be sure the thread does not call code possibly causing a deadlock in JackEngine. - ThreadExit(); - break; - - default: - break; - } - */ - #ifdef JACK_MONITOR fNetTimeMon->Add((((float)(GetMicroSeconds() - begin_time)) / (float) fPeriodUsecs) * 100.f); #endif @@ -519,26 +497,6 @@ namespace Jack JackServerGlobals::fInstance->GetEngine()->NotifyXRun(GetMicroSeconds(), 0); } - /* - switch (DataRecv()) { - - case 0: - jack_error("Connection is not yet synched, skip cycle..."); - return 0; - - case SOCKET_ERROR: - jack_error("Connection is lost, quit master..."); - //ask to the manager to properly remove the master - Exit(); - //UGLY temporary way to be sure the thread does not call code possibly causing a deadlock in JackEngine. - ThreadExit(); - break; - - default: - break; - } - */ - #ifdef JACK_MONITOR fNetTimeMon->AddLast((((float)(GetMicroSeconds() - begin_time)) / (float) fPeriodUsecs) * 100.f); #endif