Commit 41a21386 authored by sletz's avatar sletz
Browse files

Cleanup.

git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@4616 0c269be4-1314-0410-8aa9-9f06e86f4224
parent cf1cf045
......@@ -1756,14 +1756,16 @@ LIB_EXPORT int jack_client_max_real_time_priority(jack_client_t* ext_client)
return -1;
} else {
JackEngineControl* control = GetEngineControl();
return (control->fRealTime) ? control->fMaxClientPriority : -1;
return (control->fRealTime) ? control->fMaxClientPriority : -1;
}
}
LIB_EXPORT int jack_acquire_real_time_scheduling(jack_native_thread_t thread, int priority)
{
JackEngineControl* control = GetEngineControl();
return (control ? JackThread::AcquireRealTimeImp(thread, priority, GetEngineControl()->fPeriod, GetEngineControl()->fComputation, GetEngineControl()->fConstraint) : -1);
return (control
? JackThread::AcquireRealTimeImp(thread, priority, control->fPeriod, control->fComputation, control->fConstraint)
: -1);
}
LIB_EXPORT int jack_client_create_thread(jack_client_t* client,
......@@ -1779,10 +1781,7 @@ LIB_EXPORT int jack_client_create_thread(jack_client_t* client,
JackEngineControl* control = GetEngineControl();
int res = JackThread::StartImp(thread, priority, realtime, routine, arg);
return (res == 0)
? ((realtime ? JackThread::AcquireRealTimeImp(*thread, priority,
GetEngineControl()->fPeriod,
GetEngineControl()->fComputation,
GetEngineControl()->fConstraint) : res))
? ((realtime ? JackThread::AcquireRealTimeImp(*thread, priority, control->fPeriod, control->fComputation, control->fConstraint) : res))
: res;
}
......
......@@ -26,7 +26,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "JackException.h"
#include "JackAudioAdapterInterface.h"
#ifdef __cplusplus
extern "C"
{
......@@ -297,7 +296,7 @@ struct JackNetExtMaster : public JackNetMasterInterface {
void AllocPorts()
{
// Set buffers
// Set buffers
if (fParams.fSendAudioChannels > 0) {
fAudioCaptureBuffer = new float*[fParams.fSendAudioChannels];
for (int audio_port_index = 0; audio_port_index < fParams.fSendAudioChannels; audio_port_index++) {
......@@ -363,7 +362,7 @@ struct JackNetExtMaster : public JackNetMasterInterface {
}
int Read(int audio_input, float** audio_input_buffer, int midi_input, void** midi_input_buffer)
{
{
try {
assert(audio_input == fParams.fReturnAudioChannels);
......
......@@ -91,7 +91,7 @@ struct JackRequest
RequestType fType;
JackRequest()
JackRequest(): fType((RequestType)0)
{}
JackRequest(RequestType type): fType(type)
......
......@@ -61,12 +61,12 @@ void* JackShmMem::operator new(size_t size)
snprintf(name, sizeof(name), "/jack_shared%d", fSegmentNum++);
if (jack_shmalloc(name, size, &info)) {
jack_error("cannot create shared memory segment of size = %d", size, strerror(errno));
jack_error("Cannot create shared memory segment of size = %d", size, strerror(errno));
goto error;
}
if (jack_attach_shm(&info)) {
jack_error("cannot attach shared memory segment name = %s err = %s", name, strerror(errno));
jack_error("Cannot attach shared memory segment name = %s err = %s", name, strerror(errno));
jack_destroy_shm(&info);
goto error;
}
......
......@@ -190,12 +190,12 @@ main (int argc, char *argv[])
fprintf (stderr, "invalid bpm\n");
return -1;
}
bpm_string = (char *) malloc ((strlen (optarg) + 4) * sizeof (char));
bpm_string = (char *) malloc ((strlen (optarg) + 5) * sizeof (char));
strcpy (bpm_string, optarg);
strcat (bpm_string, "_bpm");
break;
case 'n':
client_name = (char *) malloc (strlen (optarg) * sizeof (char));
client_name = (char *) malloc ((strlen (optarg) + 1) * sizeof (char));
strcpy (client_name, optarg);
break;
case 'v':
......
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