channel config changes during ::configure_io() must be scoped to ensure they are complete before signals are sent

This commit is contained in:
Paul Davis 2017-07-25 12:57:07 -04:00
parent 9ce5ac9678
commit b8f16a16d0

View file

@ -147,11 +147,13 @@ DiskIOProcessor::configure_io (ChanCount in, ChanCount out)
{
DEBUG_TRACE (DEBUG::DiskIO, string_compose ("Configuring %1 for in:%2 out:%3\n", name(), in, out));
bool changed = false;
{
RCUWriter<ChannelList> writer (channels);
boost::shared_ptr<ChannelList> c = writer.get_copy();
uint32_t n_audio = in.n_audio();
bool changed = false;
if (n_audio > c->size()) {
add_channel_to (c, n_audio - c->size());
@ -161,6 +163,9 @@ DiskIOProcessor::configure_io (ChanCount in, ChanCount out)
changed = true;
}
/* writer leaves scope, actual channel list is updated */
}
if (in.n_midi() > 0 && !_midi_buf) {
const size_t size = _session.butler()->midi_diskstream_buffer_size();
_midi_buf = new MidiRingBuffer<framepos_t>(size);