From 182b23e744d79b3387a779ea25010924daffe6af Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Sun, 19 Jun 2011 21:47:21 +0000 Subject: 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 --- libs/ardour/audioengine.cc | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) (limited to 'libs') diff --git a/libs/ardour/audioengine.cc b/libs/ardour/audioengine.cc index 64f4481c6c..791a5d62a3 100644 --- a/libs/ardour/audioengine.cc +++ b/libs/ardour/audioengine.cc @@ -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; } -- cgit v1.2.3