Browse Source

Fix JackNetDriver::Close method.

git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@3347 0c269be4-1314-0410-8aa9-9f06e86f4224
tags/1.9.2
sletz 17 years ago
parent
commit
319a95c629
4 changed files with 26 additions and 21 deletions
  1. +4
    -0
      ChangeLog
  2. +19
    -16
      common/JackNetDriver.cpp
  3. +2
    -4
      common/JackNetDriver.h
  4. +1
    -1
      common/JackWaitThreadedDriver.h

+ 4
- 0
ChangeLog View File

@@ -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>


+ 19
- 16
common/JackNetDriver.cpp View File

@@ -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;


+ 2
- 4
common/JackNetDriver.h View File

@@ -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();


+ 1
- 1
common/JackWaitThreadedDriver.h View File

@@ -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.
*/



Loading…
Cancel
Save