Fix for compilation on Solaris.
git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@4670 0c269be4-1314-0410-8aa9-9f06e86f4224
This commit is contained in:
parent
20ffe1e074
commit
85df85f520
|
@ -36,6 +36,10 @@ John Emmas
|
|||
Jackdmp changes log
|
||||
---------------------------
|
||||
|
||||
2012-01-06 Stephane Letz <letz@grame.fr>
|
||||
|
||||
* Fix for compilation on Solaris.
|
||||
|
||||
2012-01-04 Stephane Letz <letz@grame.fr>
|
||||
|
||||
* Fix library symbols export issue.
|
||||
|
|
|
@ -1804,7 +1804,11 @@ LIB_EXPORT int jack_client_kill_thread(jack_client_t* client, jack_native_thread
|
|||
#ifndef WIN32
|
||||
LIB_EXPORT void jack_set_thread_creator (jack_thread_creator_t jtc)
|
||||
{
|
||||
JackGlobals::fJackThreadCreator = (jtc == NULL) ? pthread_create : jtc;
|
||||
if (jtc == NULL) {
|
||||
JackGlobals::fJackThreadCreator = pthread_create;
|
||||
} else {
|
||||
JackGlobals::fJackThreadCreator = jtc;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
@ -35,20 +35,22 @@ namespace Jack
|
|||
int JackAudioAdapter::Process(jack_nframes_t frames, void* arg)
|
||||
{
|
||||
JackAudioAdapter* adapter = static_cast<JackAudioAdapter*>(arg);
|
||||
jack_default_audio_sample_t* inputBuffer[adapter->fAudioAdapter->GetInputs()];
|
||||
jack_default_audio_sample_t* outputBuffer[adapter->fAudioAdapter->GetOutputs()];
|
||||
return adapter->ProcessAux(frames);
|
||||
}
|
||||
|
||||
int JackAudioAdapter::ProcessAux(jack_nframes_t frames)
|
||||
{
|
||||
// Always clear output
|
||||
for (int i = 0; i < adapter->fAudioAdapter->GetInputs(); i++) {
|
||||
inputBuffer[i] = (jack_default_audio_sample_t*)jack_port_get_buffer(adapter->fCapturePortList[i], frames);
|
||||
memset(inputBuffer[i], 0, frames * sizeof(jack_default_audio_sample_t));
|
||||
for (int i = 0; i < fAudioAdapter->GetInputs(); i++) {
|
||||
fInputBufferList[i] = (jack_default_audio_sample_t*)jack_port_get_buffer(fCapturePortList[i], frames);
|
||||
memset(fInputBufferList[i], 0, frames * sizeof(jack_default_audio_sample_t));
|
||||
}
|
||||
|
||||
for (int i = 0; i < adapter->fAudioAdapter->GetOutputs(); i++) {
|
||||
outputBuffer[i] = (jack_default_audio_sample_t*)jack_port_get_buffer(adapter->fPlaybackPortList[i], frames);
|
||||
for (int i = 0; i < fAudioAdapter->GetOutputs(); i++) {
|
||||
fOutputBufferList[i] = (jack_default_audio_sample_t*)jack_port_get_buffer(fPlaybackPortList[i], frames);
|
||||
}
|
||||
|
||||
adapter->fAudioAdapter->PullAndPush(inputBuffer, outputBuffer, frames);
|
||||
fAudioAdapter->PullAndPush(fInputBufferList, fOutputBufferList, frames);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -126,6 +128,9 @@ void JackAudioAdapter::FreePorts()
|
|||
|
||||
delete[] fCapturePortList;
|
||||
delete[] fPlaybackPortList;
|
||||
|
||||
delete[] fInputBufferList;
|
||||
delete[] fOutputBufferList;
|
||||
}
|
||||
|
||||
void JackAudioAdapter::ConnectPorts()
|
||||
|
@ -164,6 +169,9 @@ int JackAudioAdapter::Open()
|
|||
fCapturePortList = new jack_port_t*[fAudioAdapter->GetInputs()];
|
||||
fPlaybackPortList = new jack_port_t*[fAudioAdapter->GetOutputs()];
|
||||
|
||||
fInputBufferList = new jack_default_audio_sample_t*[fAudioAdapter->GetInputs()];
|
||||
fOutputBufferList = new jack_default_audio_sample_t*[fAudioAdapter->GetOutputs()];
|
||||
|
||||
for (int i = 0; i < fAudioAdapter->GetInputs(); i++) {
|
||||
snprintf(name, sizeof(name), "capture_%d", i + 1);
|
||||
if ((fCapturePortList[i] = jack_port_register(fClient, name, JACK_DEFAULT_AUDIO_TYPE, CaptureDriverFlags, 0)) == NULL) {
|
||||
|
|
|
@ -42,6 +42,9 @@ namespace Jack
|
|||
jack_port_t** fCapturePortList;
|
||||
jack_port_t** fPlaybackPortList;
|
||||
|
||||
jack_default_audio_sample_t** fInputBufferList;
|
||||
jack_default_audio_sample_t** fOutputBufferList;
|
||||
|
||||
jack_client_t* fClient;
|
||||
JackAudioAdapterInterface* fAudioAdapter;
|
||||
bool fAutoConnect;
|
||||
|
@ -49,6 +52,7 @@ namespace Jack
|
|||
void FreePorts();
|
||||
void ConnectPorts();
|
||||
void Reset();
|
||||
int ProcessAux(jack_nframes_t frames);
|
||||
|
||||
public:
|
||||
|
||||
|
|
|
@ -495,7 +495,7 @@ void JackDriver::SaveConnections()
|
|||
fConnections.push_back(make_pair(aliases[0], connections[j]));
|
||||
jack_info("Save connection: %s %s", aliases[0], connections[j]);
|
||||
*/
|
||||
fConnections.push_back(make_pair(fGraphManager->GetPort(fCapturePortList[i])->GetName(), connections[j]));
|
||||
fConnections.push_back(make_pair(string(fGraphManager->GetPort(fCapturePortList[i])->GetName()), string(connections[j])));
|
||||
jack_info("Save connection: %s %s", fGraphManager->GetPort(fCapturePortList[i])->GetName(), connections[j]);
|
||||
}
|
||||
free(connections);
|
||||
|
@ -510,7 +510,7 @@ void JackDriver::SaveConnections()
|
|||
fConnections.push_back(make_pair(connections[j], aliases[0]));
|
||||
jack_info("Save connection: %s %s", connections[j], aliases[0]);
|
||||
*/
|
||||
fConnections.push_back(make_pair(connections[j], fGraphManager->GetPort(fPlaybackPortList[i])->GetName()));
|
||||
fConnections.push_back(make_pair(string(connections[j]), string(fGraphManager->GetPort(fPlaybackPortList[i])->GetName())));
|
||||
jack_info("Save connection: %s %s", connections[j], fGraphManager->GetPort(fPlaybackPortList[i])->GetName());
|
||||
}
|
||||
free(connections);
|
||||
|
|
|
@ -628,7 +628,7 @@ namespace Jack
|
|||
|
||||
int NetCeltAudioBuffer::RenderFromJackPorts()
|
||||
{
|
||||
float buffer[fPeriodSize];
|
||||
float buffer[BUFFER_SIZE_MAX];
|
||||
|
||||
for (int port_index = 0; port_index < fNPorts; port_index++) {
|
||||
if (fPortBuffer[port_index]) {
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
|
||||
#include <jack/jslist.h>
|
||||
#include <jack/systemdeps.h>
|
||||
#if !defined (__sun__)
|
||||
#if !defined(sun) && !defined(__sun__)
|
||||
#include <stdbool.h>
|
||||
#endif
|
||||
|
||||
|
|
|
@ -67,6 +67,10 @@
|
|||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef JACK_WEAK_EXPORT
|
||||
#define JACK_WEAK_EXPORT
|
||||
#endif
|
||||
|
||||
#ifndef JACK_OPTIONAL_WEAK_EXPORT
|
||||
#define JACK_OPTIONAL_WEAK_EXPORT
|
||||
#endif
|
||||
|
@ -82,6 +86,11 @@
|
|||
#endif
|
||||
|
||||
#endif /* __GNUC__ */
|
||||
|
||||
#ifndef JACK_OPTIONAL_WEAK_DEPRECATED_EXPORT
|
||||
#define JACK_OPTIONAL_WEAK_DEPRECATED_EXPORT
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* __weakmacros_h__ */
|
||||
|
|
|
@ -56,7 +56,10 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|||
#define MEM_ALIGN(x,y) x
|
||||
#define LIB_EXPORT
|
||||
#define SERVER_EXPORT
|
||||
|
||||
/* Add other things here for non-gcc platforms for PRE and POST_PACKED_STRUCTURE */
|
||||
#define PRE_PACKED_STRUCTURE
|
||||
#define POST_PACKED_STRUCTURE
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
@ -859,7 +859,7 @@ SERVER_EXPORT jack_driver_desc_t* driver_get_descriptor()
|
|||
return desc;
|
||||
}
|
||||
|
||||
EXPORT Jack::JackDriverClientInterface* driver_initialize(Jack::JackLockedEngine* engine, Jack::JackSynchro* table, const JSList* params)
|
||||
SERVER_EXPORT Jack::JackDriverClientInterface* driver_initialize(Jack::JackLockedEngine* engine, Jack::JackSynchro* table, const JSList* params)
|
||||
{
|
||||
int bits = OSS_DRIVER_DEF_BITS;
|
||||
jack_nframes_t srate = OSS_DRIVER_DEF_FS;
|
||||
|
|
|
@ -776,7 +776,7 @@ SERVER_EXPORT jack_driver_desc_t* driver_get_descriptor()
|
|||
return desc;
|
||||
}
|
||||
|
||||
EXPORT Jack::JackDriverClientInterface* driver_initialize(Jack::JackLockedEngine* engine, Jack::JackSynchro* table, const JSList* params)
|
||||
SERVER_EXPORT Jack::JackDriverClientInterface* driver_initialize(Jack::JackLockedEngine* engine, Jack::JackSynchro* table, const JSList* params)
|
||||
{
|
||||
int bits = OSS_DRIVER_DEF_BITS;
|
||||
jack_nframes_t srate = OSS_DRIVER_DEF_FS;
|
||||
|
|
|
@ -477,7 +477,7 @@ int process4(jack_nframes_t nframes, void *arg)
|
|||
jack_nframes_t delta_time = cur_time - last_time;
|
||||
|
||||
Log("calling process4 callback : jack_frame_time = %ld delta_time = %ld\n", cur_time, delta_time);
|
||||
if (delta_time > 0 && (unsigned int)abs(delta_time - cur_buffer_size) > tolerance) {
|
||||
if (delta_time > 0 && (jack_nframes_t)abs((double)(delta_time - cur_buffer_size)) > tolerance) {
|
||||
printf("!!! ERROR !!! jack_frame_time seems to return incorrect values cur_buffer_size = %d, delta_time = %d\n", cur_buffer_size, delta_time);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue