Commit ab6574f2 authored by sletz's avatar sletz
Browse files

Client incorrect re-naming fixed: now done at fifo level only.

git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@3325 0c269be4-1314-0410-8aa9-9f06e86f4224
parent c75b495d
......@@ -25,7 +25,8 @@ Michael Voigt
2009-02-17 Stephane Letz <letz@grame.fr>
* Fix the mutex/signal classes on Windows.
* Fix the mutex/signal classes on Windows.
* Client incorrect re-naming fixed: now done at fifo level only.
2009-02-16 Stephane Letz <letz@grame.fr>
......@@ -33,8 +34,8 @@ Michael Voigt
2009-02-11 Stephane Letz <letz@grame.fr>
* Merge Solaris branch back on trunk.
* Equality of input and output buffer size removed (for now) in JackOSSDriver.
* Merge Solaris branch back on trunk.
* Equality of input and output buffer size removed (for now) in JackOSSDriver.
2009-02-10 Stephane Letz <letz@grame.fr>
......
......@@ -144,9 +144,9 @@ namespace Jack
for ( i = 0; i < fPlaybackChannels; i++ )
fPlaybackRingBuffer[i] = new JackLibSampleRateResampler(fAudioAdapter->GetQuality());
fAudioAdapter->SetRingBuffers ( fCaptureRingBuffer, fPlaybackRingBuffer );
if ( fCaptureChannels )
if (fCaptureChannels > 0)
jack_log ( "ReadSpace = %ld", fCaptureRingBuffer[0]->ReadSpace() );
if ( fPlaybackChannels )
if (fPlaybackChannels > 0)
jack_log ( "WriteSpace = %ld", fPlaybackRingBuffer[0]->WriteSpace() );
//jack ports
......
......@@ -926,7 +926,7 @@ int JackClient::SetProcessThread(JackThreadCallback fun, void *arg)
char* JackClient::GetInternalClientName(int ref)
{
char name_res[JACK_CLIENT_NAME_SIZE];
char name_res[JACK_CLIENT_NAME_SIZE + 1];
int result = -1;
fChannel->GetInternalClientName(GetClientControl()->fRefNum, ref, name_res, &result);
......
......@@ -52,21 +52,19 @@ extern "C"
JackLibGlobals* JackLibGlobals::fGlobals = NULL;
int JackLibGlobals::fClientCount = 0;
EXPORT jack_client_t* jack_client_open_aux(const char* ext_client_name, jack_options_t options, jack_status_t* status, va_list ap)
EXPORT jack_client_t* jack_client_open_aux(const char* client_name, jack_options_t options, jack_status_t* status, va_list ap)
{
jack_varargs_t va; /* variable arguments */
jack_status_t my_status;
JackClient* client;
char client_name[JACK_CLIENT_NAME_SIZE + 1];
if (ext_client_name == NULL) {
if (client_name == NULL) {
jack_error("jack_client_open called with a NULL client_name");
return NULL;
}
jack_log("jack_client_open %s", ext_client_name);
JackTools::RewriteName(ext_client_name, client_name);
jack_log("jack_client_open %s", client_name);
if (status == NULL) /* no status from caller? */
status = &my_status; /* use local status word */
*status = (jack_status_t)0;
......
......@@ -632,7 +632,7 @@ namespace Jack
{
char multicast_ip[16];
strcpy ( multicast_ip, DEFAULT_MULTICAST_IP );
char net_name[JACK_CLIENT_NAME_SIZE];
char net_name[JACK_CLIENT_NAME_SIZE + 1];
int udp_port = DEFAULT_PORT;
int mtu = DEFAULT_MTU;
uint transport_sync = 1;
......
......@@ -48,21 +48,19 @@ extern "C"
using namespace Jack;
EXPORT jack_client_t* jack_client_open_aux(const char* ext_client_name, jack_options_t options, jack_status_t* status, va_list ap)
EXPORT jack_client_t* jack_client_open_aux(const char* client_name, jack_options_t options, jack_status_t* status, va_list ap)
{
jack_varargs_t va; /* variable arguments */
jack_status_t my_status;
JackClient* client;
char client_name[JACK_CLIENT_NAME_SIZE + 1];
if (ext_client_name == NULL) {
if (client_name == NULL) {
jack_error("jack_client_open called with a NULL client_name");
return NULL;
}
jack_log("jack_client_open %s", ext_client_name);
JackTools::RewriteName(ext_client_name, client_name);
jack_log("jack_client_open %s", client_name);
if (status == NULL) /* no status from caller? */
status = &my_status; /* use local status word */
*status = (jack_status_t)0;
......
......@@ -169,7 +169,8 @@ namespace Jack {
}
}
int JackTools::GetTmpdir() {
int JackTools::GetTmpdir()
{
FILE* in;
size_t len;
char buf[JACK_PATH_MAX + 2]; /* allow tmpdir to live anywhere, plus newline, plus null */
......@@ -200,7 +201,8 @@ namespace Jack {
}
#endif
void JackTools::RewriteName(const char* name, char* new_name) {
void JackTools::RewriteName(const char* name, char* new_name)
{
size_t i;
for (i = 0; i < strlen(name); i++) {
if ((name[i] == '/') || (name[i] == '\\'))
......
......@@ -80,7 +80,7 @@ int JackMachClientChannel::Open(const char* server_name, const char* name, char*
}
// Prepare local port using client name
char buf[JACK_CLIENT_NAME_SIZE];
char buf[JACK_CLIENT_NAME_SIZE + 1];
snprintf(buf, sizeof(buf) - 1, "%s:%s", jack_client_entry, name_res);
if (!fClientPort.AllocatePort(buf, 16)) {
......
......@@ -18,6 +18,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "JackMachSemaphore.h"
#include "JackConstants.h"
#include "JackTools.h"
#include "JackError.h"
#include <stdio.h>
......@@ -27,9 +28,11 @@ namespace Jack
mach_port_t JackMachSemaphore::fBootPort = 0;
void JackMachSemaphore::BuildName(const char* name, const char* server_name, char* res)
void JackMachSemaphore::BuildName(const char* client_name, const char* server_name, char* res)
{
sprintf(res, "jack_mach_sem.%d_%s_%s", JackTools::GetUID(), server_name, name);
char ext_client_name[JACK_CLIENT_NAME_SIZE + 1];
JackTools::RewriteName(client_name, ext_client_name);
sprintf(res, "jack_mach_sem.%d_%s_%s", JackTools::GetUID(), server_name, ext_client_name);
}
bool JackMachSemaphore::Signal()
......
......@@ -28,9 +28,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
namespace Jack
{
void JackPosixSemaphore::BuildName(const char* name, const char* server_name, char* res)
void JackPosixSemaphore::BuildName(const char* client_name, const char* server_name, char* res)
{
sprintf(res, "jack_sem.%d_%s_%s", JackTools::GetUID(), server_name, name);
char ext_client_name[JACK_CLIENT_NAME_SIZE + 1];
JackTools::RewriteName(client_name, ext_client_name);
sprintf(res, "jack_sem.%d_%s_%s", JackTools::GetUID(), server_name, ext_client_name);
}
bool JackPosixSemaphore::Signal()
......
......@@ -77,7 +77,6 @@ int JackWinNamedPipeClientChannel::Open(const char* server_name, const char* nam
goto error;
}
fClient = obj;
return 0;
......
......@@ -18,6 +18,7 @@ This program is free software; you can redistribute it and/or modify
*/
#include "JackWinSemaphore.h"
#include "JackConstants.h"
#include "JackTools.h"
#include "JackError.h"
#include <stdio.h>
......@@ -25,9 +26,11 @@ This program is free software; you can redistribute it and/or modify
namespace Jack
{
void JackWinSemaphore::BuildName(const char* name, const char* server_name, char* res)
void JackWinSemaphore::BuildName(const char* client_name, const char* server_name, char* res)
{
sprintf(res, "jack_pipe.%s_%s", server_name, name);
char ext_client_name[JACK_CLIENT_NAME_SIZE + 1];
JackTools::RewriteName(client_name, ext_client_name);
sprintf(res, "jack_pipe.%s_%s", server_name, ext_client_name);
}
bool JackWinSemaphore::Signal()
......
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