diff options
| author | garyscavone <garyscavone@users.noreply.github.com> | 2016-02-03 16:05:14 -0500 |
|---|---|---|
| committer | garyscavone <garyscavone@users.noreply.github.com> | 2016-02-03 16:05:14 -0500 |
| commit | 447308a38f22211910439b6c7483aba7862d3f0e (patch) | |
| tree | 51989ba6fa1107b708387ad9719c12732cf48b53 | |
| parent | 7b6ed715587f3390fb4ef6b3eb532a630b5d1e7c (diff) | |
| parent | 6a06b40251823c27aa444979829621baef1ad433 (diff) | |
Merge pull request #46 from hard-mode/master
Always allocate JACK ringbuffers.
| -rw-r--r-- | RtMidi.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
@@ -2690,6 +2690,10 @@ void MidiOutJack :: connect() JackMidiData *data = static_cast<JackMidiData *> (apiData_); if ( data->client ) return; + + // Initialize output ringbuffers + data->buffSize = jack_ringbuffer_create( JACK_RINGBUFFER_SIZE ); + data->buffMessage = jack_ringbuffer_create( JACK_RINGBUFFER_SIZE ); // Initialize JACK client if (( data->client = jack_client_open( clientName.c_str(), JackNoStartServer, NULL )) == 0) { @@ -2699,8 +2703,6 @@ void MidiOutJack :: connect() } jack_set_process_callback( data->client, jackProcessOut, data ); - data->buffSize = jack_ringbuffer_create( JACK_RINGBUFFER_SIZE ); - data->buffMessage = jack_ringbuffer_create( JACK_RINGBUFFER_SIZE ); jack_activate( data->client ); } @@ -2708,12 +2710,12 @@ MidiOutJack :: ~MidiOutJack() { JackMidiData *data = static_cast<JackMidiData *> (apiData_); closePort(); - + + // Cleanup + jack_ringbuffer_free( data->buffSize ); + jack_ringbuffer_free( data->buffMessage ); if ( data->client ) { - // Cleanup jack_client_close( data->client ); - jack_ringbuffer_free( data->buffSize ); - jack_ringbuffer_free( data->buffMessage ); } delete data; |
