Make the configuration penalty subtler about inputs
[ardour.git] / libs / ardour / luaproc.cc
index 8f370ebfad57ace07ab49b83ca911914a0321b09..09be770b0a9bd2b4719acfdfffe68d58832d124e 100644 (file)
@@ -400,11 +400,10 @@ LuaProc::can_support_io_configuration (const ChanCount& in, ChanCount& out, Chan
 }
 
 #define FOUNDCFG_IMPRECISE(in, out) {                               \
-  float p = fabsf ((float)(out) - preferred_out) ;                  \
-  if (in != audio_in) {                                             \
-    p += 1000;                                                      \
-  }                                                                 \
-  if ((out) > preferred_out) { p *= 1.1; }                          \
+  const float p = fabsf ((float)(out) - preferred_out) *            \
+                      (((out) > preferred_out) ? 1.1 : 1)           \
+                + fabsf ((float)(in) - audio_in) *                  \
+                      (((in) > audio_in) ? 275 : 250);              \
   FOUNDCFG_PENALTY(in, out, p);                                     \
 }