fix split plugin default connection with strict-i/o
authorRobin Gareus <robin@gareus.org>
Thu, 14 Apr 2016 19:02:28 +0000 (21:02 +0200)
committerRobin Gareus <robin@gareus.org>
Thu, 14 Apr 2016 19:02:28 +0000 (21:02 +0200)
Only connect the available input channels, ignore others.

libs/ardour/plugin_insert.cc

index 81c15efbf157d8310080154420602c75cfc7bbf6..f7664d995130e5895d67de123a43c67c667f3a9e 100644 (file)
@@ -1280,13 +1280,19 @@ PluginInsert::reset_map (bool emit)
                                } else {
                                        if (_match.method == Split) {
                                                if (cend == 0) { continue; }
+                                               if (_strict_io && ic + stride * pc >= cend) {
+                                                       break;
+                                               }
                                                /* connect *no* sidechain sinks in round-robin fashion */
                                                _in_map[pc].set (*t, in, ic + stride * pc);
+                                               if (_strict_io && (ic + 1) == cend) {
+                                                       break;
+                                               }
                                                ic = (ic + 1) % cend;
                                        } else {
                                                uint32_t s = in - shift;
                                                if (stride * pc + s < cend) {
-                                                       _in_map[pc].set (*t, in, stride * pc + s);
+                                                       _in_map[pc].set (*t, in, s + stride * pc);
                                                }
                                        }
                                }