From fe4d0f67e46a0ad371702fde43d1d726be4a30da Mon Sep 17 00:00:00 2001 From: "Julien \"_FrnchFrgg_\" RIVAUD" Date: Wed, 1 Aug 2018 11:40:52 +0200 Subject: Remove ad-hoc handling of possible_in == 0 Just make the code responsible for possible_in > 0 also handle possible_in == 0 since it nearly does the same thing. The only difference is that the possible_in == 0 case, by using FOUNDCFG(), acted as if possible_in was audio_in. The consolidated code uses FOUNDCFG_IMPRECISE which will add some penalty to the configurations where desired_in == possible_in != audio_in. There is thus a small POLICY CHANGE, but the selected configuration will stay the same unless a better matching configuration is available. --- libs/ardour/audio_unit.cc | 21 ++------------------- 1 file changed, 2 insertions(+), 19 deletions(-) (limited to 'libs/ardour') diff --git a/libs/ardour/audio_unit.cc b/libs/ardour/audio_unit.cc index b5af76ced6..67938d2de9 100644 --- a/libs/ardour/audio_unit.cc +++ b/libs/ardour/audio_unit.cc @@ -1430,23 +1430,6 @@ AUPlugin::can_support_io_configuration (const ChanCount& in, ChanCount& out, Cha } /* now allow potentially "imprecise" matches */ - if (possible_in == 0) { - /* no inputs, generators & instruments */ - if (possible_out == -1 || possible_out == -2) { - /* any output configuration possible - * out == -2 is invalid, interpreted as out == -1 */ - FOUNDCFG (preferred_out); - ANYTHINGGOES; - } else if (possible_out < -2) { - /* variable number of outputs up to -N, */ - FOUNDCFG (min (-possible_out, preferred_out)); - UPTO (-possible_out); - } else { - /* exact number of outputs */ - FOUNDCFG (possible_out); - } - } - if (possible_in == -1 || possible_in == -2) { /* wildcard for input */ if (possible_out == possible_in) { @@ -1469,10 +1452,10 @@ AUPlugin::can_support_io_configuration (const ChanCount& in, ChanCount& out, Cha } } - if (possible_in < -2 || possible_in > 0) { + if (possible_in < -2 || possible_in >= 0) { /* specified number, exact or up to */ int32_t desired_in; - if (possible_in > 0) { + if (possible_in >= 0) { /* configuration can only match possible_in */ desired_in = possible_in; } else { -- cgit v1.2.3