fix crash caused by trying to connect monitor section before it has ports

Multimedia / Ardour - Paul Davis [linuxaudiosystems.com] - 27 February 2017 10:40 EST

This does not fix the ordering issues caused by things happening before the monitor section gaining ports

###

diff --git a/libs/ardour/auditioner.cc b/libs/ardour/auditioner.cc
index e1c04c4..b190165 100644
--- a/libs/ardour/auditioner.cc
+++ b/libs/ardour/auditioner.cc
@@ -137,25 +137,25 @@ Auditioner::connect ()
via_monitor = false;

if (left.empty() || left == "default") {
- if (_session.monitor_out()) {
- left = _session.monitor_out()->input()->audio (0)->name();
- via_monitor = true;
- } else {
+ if (_session.monitor_out() && _session.monitor_out()->input()->audio (0)) {
+ left = _session.monitor_out()->input()->audio (0)->name();
+ via_monitor = true;
+ } else {
if (outputs.size() > 0) {
left = outputs[0];
}
- }
+ }
}

if (right.empty() || right == "default") {
- if (_session.monitor_out()) {
- right = _session.monitor_out()->input()->audio (1)->name();
- via_monitor = true;
- } else {
+ if (_session.monitor_out() && _session.monitor_out()->input()->audio (1)) {
+ right = _session.monitor_out()->input()->audio (1)->name();
+ via_monitor = true;
+ } else {
if (outputs.size() > 1) {
right = outputs[1];
}
- }
+ }
}

_output->disconnect (this);

e5c6f16 fix crash caused by trying to connect monitor section before it has ports.
libs/ardour/auditioner.cc | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)

  • Share