Commit 319a95c6 authored by sletz's avatar sletz
Browse files

Fix JackNetDriver::Close method.

git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@3347 0c269be4-1314-0410-8aa9-9f06e86f4224
parent 37875f21
......@@ -22,6 +22,10 @@ Michael Voigt
---------------------------
Jackdmp changes log
---------------------------
2009-02-25 Stephane Letz <letz@grame.fr>
* Fix JackNetDriver::Close method.
2009-02-23 Stephane Letz <letz@grame.fr>
......
......@@ -91,14 +91,15 @@ namespace Jack
}
}
#ifdef JACK_MONITOR
int JackNetDriver::Close()
{
#ifdef JACK_MONITOR
if ( fNetTimeMon )
fNetTimeMon->Save();
#endif
FreeAll();
return JackDriver::Close();
}
#endif
// Attach and Detach are defined as empty methods: port allocation is done when driver actually start (that is in Init)
int JackNetDriver::Attach()
......@@ -122,8 +123,10 @@ namespace Jack
jack_log ( "JackNetDriver::Init()" );
//new loading, but existing socket, restart the driver
if ( fSocket.IsSocket() )
Restart();
if (fSocket.IsSocket()) {
jack_info( "Restarting driver..." );
FreeAll();
}
//set the parameters to send
fParams.fSendAudioChannels = fCaptureChannels;
......@@ -206,28 +209,28 @@ namespace Jack
return true;
}
void JackNetDriver::Restart()
void JackNetDriver::FreeAll()
{
jack_log ( "JackNetDriver::Restart" );
jack_info ( "Restarting driver..." );
FreePorts();
delete[] fTxBuffer;
fTxBuffer = NULL;
delete[] fRxBuffer;
fRxBuffer = NULL;
delete fNetAudioCaptureBuffer;
fNetAudioCaptureBuffer = NULL;
delete fNetAudioPlaybackBuffer;
fNetAudioPlaybackBuffer = NULL;
delete fNetMidiCaptureBuffer;
fNetMidiCaptureBuffer = NULL;
delete fNetMidiPlaybackBuffer;
fNetMidiPlaybackBuffer = NULL;
FreePorts();
delete[] fMidiCapturePortList;
fMidiCapturePortList = NULL;
delete[] fMidiPlaybackPortList;
fTxBuffer = NULL;
fRxBuffer = NULL;
fNetAudioCaptureBuffer = NULL;
fNetAudioPlaybackBuffer = NULL;
fNetMidiCaptureBuffer = NULL;
fNetMidiPlaybackBuffer = NULL;
fMidiCapturePortList = NULL;
fMidiPlaybackPortList = NULL;
#ifdef JACK_MONITOR
delete fNetTimeMon;
fNetTimeMon = NULL;
......
......@@ -51,7 +51,8 @@ namespace Jack
#endif
bool Init();
void Restart();
void FreeAll();
int AllocPorts();
int FreePorts();
......@@ -71,10 +72,7 @@ namespace Jack
int Open ( jack_nframes_t frames_per_cycle, jack_nframes_t rate, bool capturing, bool playing,
int inchannels, int outchannels, bool monitor, const char* capture_driver_name,
const char* playback_driver_name, jack_nframes_t capture_latency, jack_nframes_t playback_latency );
#ifdef JACK_MONITOR
int Close();
#endif
int Attach();
int Detach();
......
......@@ -31,7 +31,7 @@ namespace Jack
\brief To be used as a wrapper of JackNetDriver.
The idea is to behave as the "dummy" driver, until the network connection is really started and processing starts.
The Execute method will call the ProcessNull() methods until the decorated driver Init method returns.
The Execute method will call the ProcessNull method until the decorated driver Init method returns.
A helper JackDriverStarter thread is used for that purpose.
*/
......
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