13
0

Remove dangling plugin thru-connections

fixes crash when removing a thru-connected output
This commit is contained in:
Robin Gareus 2016-04-16 12:43:56 +02:00
parent 277893b130
commit 8f367ddaa0

View File

@ -1172,7 +1172,7 @@ PluginInsert::sanitize_maps ()
/* strip dead wood */
PinMappings new_ins;
PinMappings new_outs;
ChanMapping new_thru (_thru_map);
ChanMapping new_thru;
for (uint32_t pc = 0; pc < get_count(); ++pc) {
ChanMapping new_in;
@ -1216,6 +1216,17 @@ PluginInsert::sanitize_maps ()
}
}
/* remove excess thru */
for (DataType::iterator t = DataType::begin(); t != DataType::end(); ++t) {
for (uint32_t o = 0; o < _configured_out.get (*t); ++o) {
bool valid;
uint32_t idx = _thru_map.get (*t, o, &valid);
if (valid && idx < _configured_internal.get (*t)) {
new_thru.set (*t, o, idx);
}
}
}
/* prevent out + thru, existing plugin outputs override thru */
for (DataType::iterator t = DataType::begin(); t != DataType::end(); ++t) {
for (uint32_t o = 0; o < _configured_out.get (*t); ++o) {