diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2013-09-17 21:09:13 -0400 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2013-09-17 21:09:13 -0400 |
commit | f51537b71d869904c5053853ff5456faae0a3b15 (patch) | |
tree | 11b164a07daa2d35ee80a23a4092659e56a262db /libs/ardour/audioengine.cc | |
parent | 7eda429155d5eac0ea0737a87850263c526aeb5a (diff) |
substantive changes to allow the audio/MIDI setup dialog to change settings as intended
So far only tested with JACK backend, but expected to be more correct for other backends too
Diffstat (limited to 'libs/ardour/audioengine.cc')
-rw-r--r-- | libs/ardour/audioengine.cc | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/libs/ardour/audioengine.cc b/libs/ardour/audioengine.cc index d33445d08f..465f88de56 100644 --- a/libs/ardour/audioengine.cc +++ b/libs/ardour/audioengine.cc @@ -1039,12 +1039,22 @@ AudioEngine::start_latency_detection () delete _mtdm; _mtdm = 0; + /* find the ports we will connect to */ + + PortEngine::PortHandle* out = pe.get_port_by_name (_latency_output_name); + PortEngine::PortHandle* in = pe.get_port_by_name (_latency_input_name); + + if (!out || !in) { + return; + } + /* create the ports we will use to read/write data */ if ((_latency_output_port = pe.register_port ("latency_out", DataType::AUDIO, IsOutput)) == 0) { return; } if (pe.connect (_latency_output_port, _latency_output_name)) { + pe.unregister_port (_latency_output_port); return; } @@ -1060,9 +1070,9 @@ AudioEngine::start_latency_detection () LatencyRange lr; _latency_signal_latency = 0; - lr = pe.get_latency_range (_latency_input_port, false); + lr = pe.get_latency_range (in, false); _latency_signal_latency = lr.max; - lr = pe.get_latency_range (_latency_output_port, true); + lr = pe.get_latency_range (out, true); _latency_signal_latency += lr.max; /* all created and connected, lets go */ |