Unverified Commit c4f01e51 authored by Karl Linden's avatar Karl Linden
Browse files

Merge branch 'master' into waf-macosx-fixes

parents 75dfaa65 51f92388
......@@ -81,7 +81,7 @@ namespace android {
/* pointers to registry header and array */
jack_shm_header_t *Shm::jack_shm_header = NULL;
jack_shm_registry_t *Shm::jack_shm_registry = NULL;
char Shm::jack_shm_server_prefix[JACK_SERVER_NAME_SIZE] = "";
char Shm::jack_shm_server_prefix[JACK_SERVER_NAME_SIZE+1] = "";
/* jack_shm_lock_registry() serializes updates to the shared memory
* segment JACK uses to keep track of the SHM segments allocated to
......
......@@ -124,7 +124,7 @@ namespace android {
static jack_shm_info_t registry_info;
static jack_shm_header_t *jack_shm_header;
static jack_shm_registry_t *jack_shm_registry;
static char jack_shm_server_prefix[JACK_SERVER_NAME_SIZE];
static char jack_shm_server_prefix[JACK_SERVER_NAME_SIZE+1];
static int semid;
static pthread_mutex_t mutex;
static Shm* ref;
......
......@@ -1481,12 +1481,12 @@ LIB_EXPORT char* jack_get_client_name(jack_client_t* ext_client)
LIB_EXPORT int jack_client_name_size(void)
{
return JACK_CLIENT_NAME_SIZE;
return JACK_CLIENT_NAME_SIZE+1;
}
LIB_EXPORT int jack_port_name_size(void)
{
return REAL_JACK_PORT_NAME_SIZE;
return REAL_JACK_PORT_NAME_SIZE+1;
}
LIB_EXPORT int jack_port_type_size(void)
......
......@@ -115,8 +115,8 @@ int JackAudioDriver::Attach()
{
JackPort* port;
jack_port_id_t port_index;
char name[REAL_JACK_PORT_NAME_SIZE];
char alias[REAL_JACK_PORT_NAME_SIZE];
char name[REAL_JACK_PORT_NAME_SIZE+1];
char alias[REAL_JACK_PORT_NAME_SIZE+1];
int i;
jack_log("JackAudioDriver::Attach fBufferSize = %ld fSampleRate = %ld", fEngineControl->fBufferSize, fEngineControl->fSampleRate);
......
......@@ -1195,7 +1195,7 @@ int JackClient::SetLatencyCallback(JackLatencyCallback callback, void *arg)
char* JackClient::GetInternalClientName(int ref)
{
char name_res[JACK_CLIENT_NAME_SIZE + 1];
char name_res[JACK_CLIENT_NAME_SIZE+1];
int result = -1;
fChannel->GetInternalClientName(GetClientControl()->fRefNum, ref, name_res, &result);
return (result < 0) ? NULL : strdup(name_res);
......
......@@ -87,7 +87,7 @@ class SERVER_EXPORT JackClient : public JackClientInterface, public JackRunnable
void* fThreadFunArg;
void* fSessionArg;
void* fLatencyArg;
char fServerName[JACK_SERVER_NAME_SIZE];
char fServerName[JACK_SERVER_NAME_SIZE+1];
JackThread fThread; /*! Thread to execute the Process function */
detail::JackClientChannelInterface* fChannel;
......
......@@ -59,7 +59,7 @@ class JackDebugClient : public JackClient
int fIsDeactivated;
int fIsClosed;
bool fFreewheel;
char fClientName[JACK_CLIENT_NAME_SIZE + 1];
char fClientName[JACK_CLIENT_NAME_SIZE+1];
JackProcessCallback fProcessTimeCallback;
void* fProcessTimeCallbackArg;
......
......@@ -76,7 +76,7 @@ int JackDriver::Open()
}
int JackDriver::Open(jack_nframes_t buffer_size,
jack_nframes_t samplerate,
jack_nframes_t sample_rate,
bool capturing,
bool playing,
int inchannels,
......@@ -111,8 +111,8 @@ int JackDriver::Open(jack_nframes_t buffer_size,
if (buffer_size > 0) {
fEngineControl->fBufferSize = buffer_size;
}
if (samplerate > 0) {
fEngineControl->fSampleRate = samplerate;
if (sample_rate > 0) {
fEngineControl->fSampleRate = sample_rate;
}
fCaptureLatency = capture_latency;
fPlaybackLatency = playback_latency;
......@@ -125,7 +125,7 @@ int JackDriver::Open(jack_nframes_t buffer_size,
fEngineControl->UpdateTimeOut();
fGraphManager->SetBufferSize(buffer_size);
fGraphManager->SetBufferSize(fEngineControl->fBufferSize);
fGraphManager->DirectConnect(fClientControl.fRefNum, fClientControl.fRefNum); // Connect driver to itself for "sync" mode
SetupDriverSync(fClientControl.fRefNum, false);
return 0;
......@@ -422,10 +422,10 @@ static string RemoveLast(const string& name)
void JackDriver::SaveConnections(int alias)
{
const char** connections;
char alias1[REAL_JACK_PORT_NAME_SIZE];
char alias2[REAL_JACK_PORT_NAME_SIZE];
char system_alias1[REAL_JACK_PORT_NAME_SIZE];
char system_alias2[REAL_JACK_PORT_NAME_SIZE];
char alias1[REAL_JACK_PORT_NAME_SIZE+1];
char alias2[REAL_JACK_PORT_NAME_SIZE+1];
char system_alias1[REAL_JACK_PORT_NAME_SIZE+1];
char system_alias2[REAL_JACK_PORT_NAME_SIZE+1];
char* aliases[2];
char* system_aliases[2];
......@@ -506,8 +506,8 @@ void JackDriver::SaveConnections(int alias)
string JackDriver::MatchPortName(const char* name, const char** ports, int alias, const std::string& type)
{
char alias1[REAL_JACK_PORT_NAME_SIZE];
char alias2[REAL_JACK_PORT_NAME_SIZE];
char alias1[REAL_JACK_PORT_NAME_SIZE+1];
char alias2[REAL_JACK_PORT_NAME_SIZE+1];
char* aliases[2];
aliases[0] = alias1;
......
......@@ -129,10 +129,9 @@ class SERVER_EXPORT JackDriver : public JackDriverClientInterface
protected:
char fCaptureDriverName[JACK_CLIENT_NAME_SIZE + 1];
char fPlaybackDriverName[JACK_CLIENT_NAME_SIZE + 1];
char fAliasName[JACK_CLIENT_NAME_SIZE + 1];
char fCaptureDriverName[JACK_CLIENT_NAME_SIZE+1];
char fPlaybackDriverName[JACK_CLIENT_NAME_SIZE+1];
char fAliasName[JACK_CLIENT_NAME_SIZE+1];
jack_nframes_t fCaptureLatency;
jack_nframes_t fPlaybackLatency;
......
......@@ -1038,7 +1038,7 @@ int JackEngine::PortDisconnect(int refnum, jack_port_id_t src, jack_port_id_t ds
int JackEngine::PortRename(int refnum, jack_port_id_t port, const char* name)
{
char old_name[REAL_JACK_PORT_NAME_SIZE];
char old_name[REAL_JACK_PORT_NAME_SIZE+1];
strcpy(old_name, fGraphManager->GetPort(port)->GetName());
fGraphManager->GetPort(port)->SetName(name);
NotifyPortRename(port, old_name);
......
......@@ -63,7 +63,7 @@ struct SERVER_EXPORT JackEngineControl : public JackShmMem
int fServerPriority;
int fClientPriority;
int fMaxClientPriority;
char fServerName[JACK_SERVER_NAME_SIZE];
char fServerName[JACK_SERVER_NAME_SIZE+1];
JackTransportEngine fTransport;
jack_timer_type_t fClockSource;
int fDriverNum;
......
......@@ -301,8 +301,9 @@ int JackGraphManager::ComputeTotalLatencies()
jack_port_id_t port_index;
for (port_index = FIRST_AVAILABLE_PORT; port_index < fPortMax; port_index++) {
JackPort* port = GetPort(port_index);
if (port->IsUsed())
if (port->IsUsed()) {
ComputeTotalLatency(port_index);
}
}
return 0;
}
......@@ -321,14 +322,17 @@ void JackGraphManager::RecalculateLatencyAux(jack_port_id_t port_index, jack_lat
dst_port->GetLatencyRange(mode, &other_latency);
if (other_latency.max > latency.max)
if (other_latency.max > latency.max) {
latency.max = other_latency.max;
if (other_latency.min < latency.min)
}
if (other_latency.min < latency.min) {
latency.min = other_latency.min;
}
}
if (latency.min == UINT32_MAX)
if (latency.min == UINT32_MAX) {
latency.min = 0;
}
port->SetLatencyRange(mode, &latency);
}
......@@ -355,8 +359,9 @@ void JackGraphManager::SetBufferSize(jack_nframes_t buffer_size)
jack_port_id_t port_index;
for (port_index = FIRST_AVAILABLE_PORT; port_index < fPortMax; port_index++) {
JackPort* port = GetPort(port_index);
if (port->IsUsed())
if (port->IsUsed()) {
port->ClearBuffer(buffer_size);
}
}
}
......@@ -370,8 +375,9 @@ jack_port_id_t JackGraphManager::AllocatePortAux(int refnum, const char* port_na
JackPort* port = GetPort(port_index);
if (!port->IsUsed()) {
jack_log("JackGraphManager::AllocatePortAux port_index = %ld name = %s type = %s", port_index, port_name, port_type);
if (!port->Allocate(refnum, port_name, port_type, flags))
if (!port->Allocate(refnum, port_name, port_type, flags)) {
return NO_PORT;
}
break;
}
}
......
......@@ -98,7 +98,7 @@ int JackLibClient::Open(const char* server_name, const char* name, int uuid, jac
strncpy(fServerName, server_name, sizeof(fServerName));
// Open server/client channel
char name_res[JACK_CLIENT_NAME_SIZE + 1];
char name_res[JACK_CLIENT_NAME_SIZE+1];
if (fChannel->Open(server_name, name, uuid, name_res, this, options, status) < 0) {
jack_error("Cannot connect to the server");
goto error;
......
......@@ -99,8 +99,9 @@ LIB_EXPORT
size_t jack_midi_max_event_size(void* port_buffer)
{
JackMidiBuffer *buf = (JackMidiBuffer*)port_buffer;
if (buf && buf->IsValid())
if (buf && buf->IsValid()) {
return buf->MaxEventSize();
}
return 0;
}
......@@ -152,7 +153,8 @@ LIB_EXPORT
uint32_t jack_midi_get_lost_event_count(void* port_buffer)
{
JackMidiBuffer *buf = (JackMidiBuffer*)port_buffer;
if (buf && buf->IsValid())
if (buf && buf->IsValid()) {
return buf->lost_events;
}
return 0;
}
......@@ -58,8 +58,8 @@ int JackMidiDriver::Attach()
{
JackPort* port;
jack_port_id_t port_index;
char name[REAL_JACK_PORT_NAME_SIZE];
char alias[REAL_JACK_PORT_NAME_SIZE];
char name[REAL_JACK_PORT_NAME_SIZE+1];
char alias[REAL_JACK_PORT_NAME_SIZE+1];
int i;
jack_log("JackMidiDriver::Attach fBufferSize = %ld fSampleRate = %ld", fEngineControl->fBufferSize, fEngineControl->fSampleRate);
......
......@@ -51,7 +51,7 @@ struct SERVER_EXPORT JackMidiEvent
uint32_t time;
jack_shmsize_t size;
union {
jack_shmsize_t offset;
jack_shmsize_t offset;
jack_midi_data_t data[INLINE_SIZE_MAX];
};
......
......@@ -519,7 +519,7 @@ struct JackNetExtSlave : public JackNetSlaveInterface, public JackRunnableInterf
fBufferSizeCallback(NULL), fBufferSizeArg(NULL),
fSampleRateCallback(NULL), fSampleRateArg(NULL)
{
char host_name[JACK_CLIENT_NAME_SIZE];
char host_name[JACK_CLIENT_NAME_SIZE + 1];
// Request parameters
assert(strlen(ip) < 32);
......
......@@ -318,8 +318,8 @@ namespace Jack
JackPort* port;
jack_port_id_t port_index;
char name[REAL_JACK_PORT_NAME_SIZE];
char alias[REAL_JACK_PORT_NAME_SIZE];
char name[REAL_JACK_PORT_NAME_SIZE+1];
char alias[REAL_JACK_PORT_NAME_SIZE+1];
int audio_port_index;
int midi_port_index;
......@@ -720,7 +720,7 @@ Deactivated for now..
SERVER_EXPORT Jack::JackDriverClientInterface* driver_initialize(Jack::JackLockedEngine* engine, Jack::JackSynchro* table, const JSList* params)
{
char multicast_ip[32];
char net_name[JACK_CLIENT_NAME_SIZE + 1] = {0};
char net_name[JACK_CLIENT_NAME_SIZE+1] = {0};
int udp_port;
int mtu = DEFAULT_MTU;
// Desactivated for now...
......
......@@ -94,9 +94,9 @@ namespace Jack
char fPacketType[8]; //packet type ('param')
uint32_t fProtocolVersion; //version
int32_t fPacketID; //indicates the packet type
char fName[JACK_CLIENT_NAME_SIZE]; //slave's name
char fMasterNetName[JACK_SERVER_NAME_SIZE]; //master hostname (network)
char fSlaveNetName[JACK_SERVER_NAME_SIZE]; //slave hostname (network)
char fName[JACK_CLIENT_NAME_SIZE+1]; //slave's name
char fMasterNetName[JACK_SERVER_NAME_SIZE+1]; //master hostname (network)
char fSlaveNetName[JACK_SERVER_NAME_SIZE+1]; //slave hostname (network)
uint32_t fMtu; //connection mtu
uint32_t fID; //slave's ID
uint32_t fTransportSync; //is the transport synced ?
......
......@@ -230,7 +230,7 @@ void JackPort::SetName(const char* new_name)
bool JackPort::NameEquals(const char* target)
{
char buf[REAL_JACK_PORT_NAME_SIZE];
char buf[REAL_JACK_PORT_NAME_SIZE+1];
/* this nasty, nasty kludge is here because between 0.109.0 and 0.109.1,
the ALSA audio backend had the name "ALSA", whereas as before and
......
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