mirror of
https://github.com/Ardour/ardour.git
synced 2026-01-29 08:23:01 +01:00
conditionally compile support for jack_port_type_get_buffer_size() and if available at compile AND runtime, use it in preference to jack_port_get_buffer_size() during a reconnect to JACK
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@9646 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
888b025f79
commit
71a32f5a00
2 changed files with 36 additions and 2 deletions
|
|
@ -138,6 +138,23 @@ ardour.Append(CXXFLAGS="-DLOCALEDIR=\\\"" + os.path.join (final_prefix, 'share',
|
|||
|
||||
ardour.Merge ([ libraries['jack'] ])
|
||||
|
||||
#
|
||||
# See if JACK supports jack_port_type_get_buffer_size()
|
||||
#
|
||||
jack_port_type_buffer_size_source_file = """
|
||||
#include <jack/jack.h>
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
jack_port_type_get_buffer_size (0, JACK_DEFAULT_AUDIO_TYPE);
|
||||
return 0;
|
||||
}
|
||||
"""
|
||||
def CheckJackPortTypeGetBufferSize(context):
|
||||
context.Message('Checking for jack_port_type_get_buffer_size()...')
|
||||
result = context.TryLink(jack_port_type_buffer_size_source_file, '.c')
|
||||
context.Result(result)
|
||||
return result
|
||||
|
||||
#
|
||||
# See if JACK supports jack_client_open()
|
||||
#
|
||||
|
|
@ -236,12 +253,16 @@ conf = Configure(ardour, custom_tests = {
|
|||
'CheckJackOnInfoShutdown' : CheckJackOnInfoShutdown,
|
||||
'CheckJackRecomputeLatencies' : CheckJackRecomputeLatencies,
|
||||
'CheckJackVideoFrameOffset' : CheckJackVideoFrameOffset,
|
||||
'CheckJackEnsureMonitorInput' : CheckJackEnsureMonitorInput
|
||||
'CheckJackEnsureMonitorInput' : CheckJackEnsureMonitorInput,
|
||||
'CheckJackPortTypeGetBufferSize' : CheckJackPortTypeGetBufferSize
|
||||
})
|
||||
|
||||
if conf.CheckJackClientOpen():
|
||||
ardour.Append(CXXFLAGS="-DHAVE_JACK_CLIENT_OPEN")
|
||||
|
||||
if conf.CheckJackPortTypeGetBufferSize():
|
||||
ardour.Append(CXXFLAGS="-DHAVE_JACK_PORT_TYPE_GET_BUFFER_SIZE")
|
||||
|
||||
if conf.CheckJackOnInfoShutdown():
|
||||
ardour.Append(CXXFLAGS="-DHAVE_JACK_ON_INFO_SHUTDOWN")
|
||||
|
||||
|
|
|
|||
|
|
@ -1249,7 +1249,20 @@ AudioEngine::reconnect_to_jack ()
|
|||
|
||||
if (session) {
|
||||
session->reset_jack_connection (_priv_jack);
|
||||
nframes_t blocksize = jack_get_buffer_size (_priv_jack);
|
||||
|
||||
nframes_t blocksize;
|
||||
|
||||
#ifdef HAVE_JACK_PORT_TYPE_GET_BUFFER_SIZE
|
||||
if (jack_port_type_get_buffer_size) {
|
||||
blocksize = jack_port_type_get_buffer_size (_priv_jack, JACK_DEFAULT_AUDIO_TYPE);
|
||||
} else {
|
||||
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);
|
||||
}
|
||||
#else
|
||||
blocksize = jack_get_buffer_size (_priv_jack);
|
||||
#endif
|
||||
|
||||
Port::set_buffer_size (blocksize);
|
||||
session->set_block_size (blocksize);
|
||||
session->set_frame_rate (jack_get_sample_rate (_priv_jack));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue