13
0

Real fix for Jack MIDI crash. Maybe!

git-svn-id: svn://localhost/ardour2/branches/midi@1782 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
David Robillard 2007-05-04 02:50:31 +00:00
parent acdfe9857a
commit b8e9b3f071
5 changed files with 17 additions and 17 deletions

View File

@ -191,7 +191,7 @@ int main (int argc, char *argv[])
#endif
{
ARDOUR::AudioEngine *engine;
ARDOUR::AudioEngine *engine = NULL;
vector<Glib::ustring> null_file_list;
Glib::thread_init();
@ -251,7 +251,7 @@ int main (int argc, char *argv[])
PBD::ID::init ();
try {
try {
ui = new ARDOUR_UI (&argc, &argv, which_ui_rcfile());
} catch (failed_constructor& err) {
error << _("could not create ARDOUR GUI") << endmsg;
@ -270,7 +270,7 @@ int main (int argc, char *argv[])
}
try {
ARDOUR::init (*engine, use_vst, try_hw_optimization);
ARDOUR::init (use_vst, try_hw_optimization);
setup_gtk_ardour_enums ();
Config->set_current_owner (ConfigVariableBase::Interface);
ui->setup_profile ();
@ -282,6 +282,8 @@ int main (int argc, char *argv[])
error << string_compose (_("Could not connect to JACK server as \"%1\""), jack_client_name) << endmsg;
return -1;
}
ARDOUR::setup_midi(*engine);
ui->set_engine (*engine);

View File

@ -44,8 +44,10 @@ namespace ARDOUR {
static const nframes_t max_frames = JACK_MAX_FRAMES;
int init (AudioEngine& engine, bool with_vst, bool try_optimization);
int init (bool with_vst, bool try_optimization);
int cleanup ();
int setup_midi(AudioEngine& engine);
std::string get_ardour_revision ();

View File

@ -108,8 +108,8 @@ setup_osc ()
}
#endif
static int
setup_midi (AudioEngine& engine )
int
ARDOUR::setup_midi (AudioEngine& engine)
{
std::map<string,Configuration::MidiPortDescriptor*>::iterator i;
int nports;
@ -286,7 +286,7 @@ setup_hardware_optimization (bool try_optimization)
}
int
ARDOUR::init (ARDOUR::AudioEngine& engine, bool use_vst, bool try_optimization)
ARDOUR::init (bool use_vst, bool try_optimization)
{
extern void setup_enum_writer ();
@ -307,10 +307,6 @@ ARDOUR::init (ARDOUR::AudioEngine& engine, bool use_vst, bool try_optimization)
Profile = new RuntimeProfile;
if (setup_midi (engine)) {
return -1;
}
#ifdef HAVE_LIBLO
if (setup_osc ()) {
return -1;

View File

@ -100,7 +100,7 @@ JACK_MidiPort::create_ports(PortRequest & req)
assert(!_jack_input_port);
assert(!_jack_output_port);
//jack_nframes_t nframes = jack_get_buffer_size(_jack_client);
jack_nframes_t nframes = jack_get_buffer_size(_jack_client);
bool ret = true;
@ -108,8 +108,8 @@ JACK_MidiPort::create_ports(PortRequest & req)
_jack_output_port = jack_port_register(_jack_client,
string(req.tagname).append("_out").c_str(),
JACK_DEFAULT_MIDI_TYPE, JackPortIsOutput, 0);
//jack_midi_clear_buffer(
// jack_port_get_buffer(_jack_output_port, nframes));
jack_midi_clear_buffer(
jack_port_get_buffer(_jack_output_port, nframes));
ret = ret && (_jack_output_port != NULL);
}
@ -117,8 +117,8 @@ JACK_MidiPort::create_ports(PortRequest & req)
_jack_input_port = jack_port_register(_jack_client,
string(req.tagname).append("_in").c_str(),
JACK_DEFAULT_MIDI_TYPE, JackPortIsInput, 0);
//jack_midi_clear_buffer(
// jack_port_get_buffer(_jack_input_port, nframes));
jack_midi_clear_buffer(
jack_port_get_buffer(_jack_input_port, nframes));
ret = ret && (_jack_input_port != NULL);
}

View File

@ -18,7 +18,7 @@
#ifndef JACK_COMPAT_H
#define JACK_COMPAT_H
#define JACK_MIDI_NEEDS_NFRAMES
//#define JACK_MIDI_NEEDS_NFRAMES
#if defined(JACK_MIDI_NEEDS_NFRAMES)