diff options
author | Robin Gareus <robin@gareus.org> | 2014-01-26 00:46:39 +0100 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2014-01-26 00:46:39 +0100 |
commit | 9a190b8d2b6e78658ea625322323728ad1c9929b (patch) | |
tree | 6fe2f261cc50dd0fb5751436226dbc2bb1b59181 /libs/ardour/plugin_insert.cc | |
parent | 40d8c5ae01f25e02457c554170a53d537246a7d4 (diff) |
fix crash when removing synth from midi-track
(and there are bypassed audio-plugins after said synth)
Diffstat (limited to 'libs/ardour/plugin_insert.cc')
-rw-r--r-- | libs/ardour/plugin_insert.cc | 32 |
1 files changed, 12 insertions, 20 deletions
diff --git a/libs/ardour/plugin_insert.cc b/libs/ardour/plugin_insert.cc index f2689bf998..2f90017498 100644 --- a/libs/ardour/plugin_insert.cc +++ b/libs/ardour/plugin_insert.cc @@ -464,39 +464,31 @@ PluginInsert::run (BufferSet& bufs, framepos_t /*start_frame*/, framepos_t /*end } } else { - if (has_no_audio_inputs()) { + uint32_t in = input_streams ().n_audio (); + uint32_t out = output_streams().n_audio (); + + if (has_no_audio_inputs() || in == 0) { /* silence all (audio) outputs. Should really declick * at the transitions of "active" */ - uint32_t out = output_streams().n_audio (); - for (uint32_t n = 0; n < out; ++n) { bufs.get_audio (n).silence (nframes); } - bufs.count().set_audio (out); - - } else { - - /* does this need to be done with MIDI? it appears not */ + } else if (out > in) { - uint32_t in = input_streams ().n_audio (); - uint32_t out = output_streams().n_audio (); + /* not active, but something has make up for any channel count increase */ - if (out > in) { - - /* not active, but something has make up for any channel count increase */ - - // TODO: option round-robin (n % in) or silence additional buffers ?? - for (uint32_t n = in; n < out; ++n) { - bufs.get_audio(n).read_from(bufs.get_audio(in - 1), nframes); - } + // TODO: option round-robin (n % in) or silence additional buffers ?? + // for now , simply replicate last buffer + for (uint32_t n = in; n < out; ++n) { + bufs.get_audio(n).read_from(bufs.get_audio(in - 1), nframes); } - - bufs.count().set_audio (out); } + + bufs.count().set_audio (out); } _active = _pending_active; |