13
0

cleanup confused mess related to jack_port_type_get_buffer_size()

git-svn-id: svn://localhost/ardour2/branches/3.0@9747 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Paul Davis 2011-06-19 21:47:21 +00:00
parent 01e006e46e
commit 182b23e744

View File

@ -206,34 +206,28 @@ AudioEngine::start ()
if (!_running) {
pframes_t blocksize;
if (jack_port_type_get_buffer_size) {
blocksize = jack_port_type_get_buffer_size (_priv_jack, JACK_DEFAULT_AUDIO_TYPE);
} else {
if (!jack_port_type_get_buffer_size) {
warning << _("This version of JACK is old - you should upgrade to a newer version that supports jack_port_type_get_buffer_size()") << endmsg;
blocksize = jack_get_buffer_size (_priv_jack);
}
}
if (_session) {
BootMessage (_("Connect session to engine"));
_session->set_block_size (blocksize);
_session->set_frame_rate (jack_get_sample_rate (_priv_jack));
}
_processed_frames = 0;
last_monitor_check = 0;
set_jack_callbacks ();
/* a proxy for whether jack_activate() will definitely call the buffer size
* callback. with older versions of JACK, this function symbol will be null.
* this is reliable, but not clean.
*/
if (!jack_port_type_get_buffer_size) {
jack_bufsize_callback (blocksize);
jack_bufsize_callback (jack_get_buffer_size (_priv_jack));
}
_processed_frames = 0;
last_monitor_check = 0;
set_jack_callbacks ();
if (jack_activate (_priv_jack) == 0) {
_running = true;
@ -243,7 +237,7 @@ AudioEngine::start ()
// error << _("cannot activate JACK client") << endmsg;
}
}
return _running ? 0 : -1;
}