Instead of setting \imprecise at the end of the loop if a configuration
was found (which clobbered valuable information, see
dae2406187), set it
each time a new configuration is chosen.
In the second loop that tries harder, resetting \imprecise also avoids a
previous "imprecise->set(AUDIO, 0)" to last even if another
configuration is chosen later.
Last but not least, it will enable correctly setting the midi input
count hoped for by the configuration.
if ((nch) > preferred_out) { p *= 1.1; } \
if (p < penalty) { \
audio_out = (nch); \
+ if (imprecise) { \
+ *imprecise = in; \
+ } \
penalty = p; \
found = true; \
} \
}
- if (found && imprecise) {
- *imprecise = in;
- }
-
if (!found && imprecise) {
/* try harder */
for (luabridge::Iterator i (iotable); !i.isNil (); ++i) {
assert (possible_in > 0); // all other cases will have been matched above
- imprecise->set (DataType::AUDIO, possible_in);
if (possible_out == -1 || possible_out == -2) {
FOUNDCFG (2);
} else if (possible_out < -2) {
/* exact number of outputs */
FOUNDCFG (possible_out);
}
+ imprecise->set (DataType::AUDIO, possible_in);
// ideally we'll also find the closest, best matching
// input configuration with minimal output penalty...
}