Commit 5bbc8e99 authored by sletz's avatar sletz
Browse files

Change fMulticastIP handling in JackNetInterface.

git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@3330 0c269be4-1314-0410-8aa9-9f06e86f4224
parent 8b0e453d
......@@ -26,6 +26,7 @@ Michael Voigt
2009-02-20 Stephane Letz <letz@grame.fr>
* Add InitConnection and InitRendering methods in JackNetSlaveInterface, better packet type checking in JackNetSlaveInterface::SyncRecv.
* Change fMulticastIP handling in JackNetInterface.
2009-02-17 Stephane Letz <letz@grame.fr>
......
......@@ -34,7 +34,6 @@ namespace Jack
//we can't call JackNetSlaveInterface constructor with some parameters before
//because we don't have full parametering right now
//parameters will be parsed from the param list, and then JackNetSlaveInterface will be filled with proper values
fMulticastIP = new char[16];
strcpy ( fMulticastIP, DEFAULT_MULTICAST_IP );
uint port = DEFAULT_PORT;
GetHostName ( fParams.fName, JACK_CLIENT_NAME_SIZE );
......@@ -60,10 +59,10 @@ namespace Jack
switch ( param->character )
{
case 'a' :
if ( strlen ( param->value.str ) < 16 )
strcpy ( fMulticastIP, param->value.str );
if (strlen (param->value.str) < 32)
strcpy(fMulticastIP, param->value.str);
else
jack_error ( "Can't use multicast address %s, using default %s", param->value.ui, DEFAULT_MULTICAST_IP );
jack_error("Can't use multicast address %s, using default %s", param->value.ui, DEFAULT_MULTICAST_IP);
break;
case 'p' :
fSocket.SetPort ( param->value.ui );
......
......@@ -36,7 +36,6 @@ namespace Jack
JackNetInterface::JackNetInterface() : fSocket()
{
fMulticastIP = NULL;
fTxBuffer = NULL;
fRxBuffer = NULL;
fNetAudioCaptureBuffer = NULL;
......@@ -47,7 +46,7 @@ namespace Jack
JackNetInterface::JackNetInterface ( const char* multicast_ip, int port ) : fSocket ( multicast_ip, port )
{
fMulticastIP = strdup ( multicast_ip );
strcpy(fMulticastIP, multicast_ip);
fTxBuffer = NULL;
fRxBuffer = NULL;
fNetAudioCaptureBuffer = NULL;
......@@ -59,7 +58,7 @@ namespace Jack
JackNetInterface::JackNetInterface ( session_params_t& params, JackNetSocket& socket, const char* multicast_ip ) : fSocket ( socket )
{
fParams = params;
fMulticastIP = strdup ( multicast_ip );
strcpy(fMulticastIP, multicast_ip);
fTxBuffer = NULL;
fRxBuffer = NULL;
fNetAudioCaptureBuffer = NULL;
......@@ -75,7 +74,6 @@ namespace Jack
fSocket.Close();
delete[] fTxBuffer;
delete[] fRxBuffer;
delete[] fMulticastIP;
delete fNetAudioCaptureBuffer;
delete fNetAudioPlaybackBuffer;
delete fNetMidiCaptureBuffer;
......
......@@ -34,7 +34,7 @@ namespace Jack
protected:
session_params_t fParams;
JackNetSocket fSocket;
char* fMulticastIP;
char fMulticastIP[32];
uint fNSubProcess;
//headers
......
......@@ -474,7 +474,7 @@ namespace Jack
fManagerClient = client;
fManagerName = jack_get_client_name ( fManagerClient );
fMulticastIP = DEFAULT_MULTICAST_IP;
strcpy(fMulticastIP, DEFAULT_MULTICAST_IP);
fSocket.SetPort ( DEFAULT_PORT );
fGlobalID = 0;
fRunning = true;
......@@ -487,7 +487,10 @@ namespace Jack
switch ( param->character )
{
case 'a' :
fMulticastIP = strdup ( param->value.str );
if (strlen (param->value.str) < 32)
strcpy(fMulticastIP, param->value.str);
else
jack_error("Can't use multicast address %s, using default %s", param->value.ui, DEFAULT_MULTICAST_IP);
break;
case 'p':
fSocket.SetPort ( param->value.ui );
......
......@@ -101,7 +101,7 @@ namespace Jack
jack_client_t* fManagerClient;
const char* fManagerName;
const char* fMulticastIP;
char fMulticastIP[32];
JackNetSocket fSocket;
pthread_t fManagerThread;
master_list_t fMasterList;
......
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