fix crash when removing synth from midi-track
(and there are bypassed audio-plugins after said synth)
This commit is contained in:
parent
40d8c5ae01
commit
9a190b8d2b
@ -464,32 +464,25 @@ PluginInsert::run (BufferSet& bufs, framepos_t /*start_frame*/, framepos_t /*end
|
|||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} 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
|
/* silence all (audio) outputs. Should really declick
|
||||||
* at the transitions of "active"
|
* at the transitions of "active"
|
||||||
*/
|
*/
|
||||||
|
|
||||||
uint32_t out = output_streams().n_audio ();
|
|
||||||
|
|
||||||
for (uint32_t n = 0; n < out; ++n) {
|
for (uint32_t n = 0; n < out; ++n) {
|
||||||
bufs.get_audio (n).silence (nframes);
|
bufs.get_audio (n).silence (nframes);
|
||||||
}
|
}
|
||||||
|
|
||||||
bufs.count().set_audio (out);
|
} else if (out > in) {
|
||||||
|
|
||||||
} else {
|
|
||||||
|
|
||||||
/* does this need to be done with MIDI? it appears not */
|
|
||||||
|
|
||||||
uint32_t in = input_streams ().n_audio ();
|
|
||||||
uint32_t out = output_streams().n_audio ();
|
|
||||||
|
|
||||||
if (out > in) {
|
|
||||||
|
|
||||||
/* not active, but something has make up for any channel count increase */
|
/* not active, but something has make up for any channel count increase */
|
||||||
|
|
||||||
// TODO: option round-robin (n % in) or silence additional buffers ??
|
// TODO: option round-robin (n % in) or silence additional buffers ??
|
||||||
|
// for now , simply replicate last buffer
|
||||||
for (uint32_t n = in; n < out; ++n) {
|
for (uint32_t n = in; n < out; ++n) {
|
||||||
bufs.get_audio(n).read_from(bufs.get_audio(in - 1), nframes);
|
bufs.get_audio(n).read_from(bufs.get_audio(in - 1), nframes);
|
||||||
}
|
}
|
||||||
@ -497,7 +490,6 @@ PluginInsert::run (BufferSet& bufs, framepos_t /*start_frame*/, framepos_t /*end
|
|||||||
|
|
||||||
bufs.count().set_audio (out);
|
bufs.count().set_audio (out);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
_active = _pending_active;
|
_active = _pending_active;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user