Some improvements to performance with crossfades: don't recompute a whole track's...
[ardour.git] / libs / ardour / audio_unit.cc
index 0d069c0c23ecc53905ea9ba303141a5a67c55459..9b313a3659634df41a261b15ae7b87a7e18febd0 100644 (file)
@@ -798,6 +798,9 @@ AUPlugin::can_do (int32_t in, int32_t& out)
                        }
                }
 
+               if (plugcnt == 1) {
+                       break;
+               }
        }
 
        /* no fit */
@@ -1650,8 +1653,10 @@ AUPluginInfo::discover_by_description (PluginInfoList& plugs, CAComponentDescrip
                if (cached_io_configuration (info->unique_id, info->version, cacomp, info->cache, info->name)) {
 
                        /* here we have to map apple's wildcard system to a simple pair
-                          of values.
-                       */
+                          of values. in ::can_do() we use the whole system, but here
+                          we need a single pair of values. XXX probably means we should
+                          remove any use of these values.
+                       */
 
                        info->n_inputs = info->cache.io_configs.front().first;
                        info->n_outputs = info->cache.io_configs.front().second;
@@ -1824,7 +1829,8 @@ AUPluginInfo::load_cached_info ()
                        }
 
                        std::string id = prop->value();
-                       
+                       AUPluginCachedInfo cinfo;
+
                        for (XMLNodeConstIterator giter = gchildren.begin(); giter != gchildren.end(); giter++) {
 
                                gchild = *giter;
@@ -1841,12 +1847,14 @@ AUPluginInfo::load_cached_info ()
                                                in = atoi (iprop->value());
                                                out = atoi (iprop->value());
                                                
-                                               AUPluginCachedInfo cinfo;
                                                cinfo.io_configs.push_back (pair<int,int> (in, out));
-                                               add_cached_info (id, cinfo);
                                        }
                                }
                        }
+
+                       if (cinfo.io_configs.size()) {
+                               add_cached_info (id, cinfo);
+                       }
                }
        }