Fix duplicate Port flush_buffer calls (#9481)
Since62fc1d3c2e
, Delivery buffers were flushed twice. Once by copy_to_outputs() and again later by Delivery::flush_buffers. This resulted in duplicate events during export (see576840c09e
, MIDI buffers are not cleared after flush to allow export processing to grab the data from the port-buffers). The workaround in62fc1d3c2e
is only relevant for ClickIO, other Deliveries (Send is a Delivery) are explicitly flushed by Route::flush_processor_buffers_locked.
This commit is contained in:
parent
576840c09e
commit
44a2ef9098
@ -193,6 +193,7 @@ public:
|
|||||||
|
|
||||||
void collect_input (BufferSet& bufs, pframes_t nframes, ChanCount offset);
|
void collect_input (BufferSet& bufs, pframes_t nframes, ChanCount offset);
|
||||||
void copy_to_outputs (BufferSet& bufs, DataType type, pframes_t nframes, samplecnt_t offset);
|
void copy_to_outputs (BufferSet& bufs, DataType type, pframes_t nframes, samplecnt_t offset);
|
||||||
|
void flush_buffers (pframes_t nframes);
|
||||||
|
|
||||||
/* AudioTrack::deprecated_use_diskstream_connections() needs these */
|
/* AudioTrack::deprecated_use_diskstream_connections() needs these */
|
||||||
|
|
||||||
|
@ -534,16 +534,10 @@ void
|
|||||||
Delivery::flush_buffers (samplecnt_t nframes)
|
Delivery::flush_buffers (samplecnt_t nframes)
|
||||||
{
|
{
|
||||||
/* io_lock, not taken: function must be called from Session::process() calltree */
|
/* io_lock, not taken: function must be called from Session::process() calltree */
|
||||||
|
if (_output) {
|
||||||
if (!_output) {
|
_output->flush_buffers (nframes);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
PortSet& ports (_output->ports());
|
|
||||||
|
|
||||||
for (PortSet::iterator i = ports.begin(); i != ports.end(); ++i) {
|
|
||||||
i->flush_buffers (nframes);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -1688,9 +1688,13 @@ IO::copy_to_outputs (BufferSet& bufs, DataType type, pframes_t nframes, samplecn
|
|||||||
port_buffer.read_from (*prev, nframes, offset);
|
port_buffer.read_from (*prev, nframes, offset);
|
||||||
++o;
|
++o;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
IO::flush_buffers (pframes_t nframes)
|
||||||
|
{
|
||||||
/* when port is both externally and internally connected,
|
/* when port is both externally and internally connected,
|
||||||
* make data directly available to downstream internal ports */
|
* make data available to downstream internal ports */
|
||||||
for (auto const& p : _ports) {
|
for (auto const& p : _ports) {
|
||||||
p->flush_buffers (nframes);
|
p->flush_buffers (nframes);
|
||||||
}
|
}
|
||||||
|
@ -495,9 +495,7 @@ IOPlug::connect_and_run (samplepos_t start, pframes_t n_samples)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (PortSet::iterator i = ports.begin(); i != ports.end(); ++i) {
|
_output->flush_buffers (n_samples);;
|
||||||
i->flush_buffers (n_samples);
|
|
||||||
}
|
|
||||||
|
|
||||||
const samplecnt_t l = effective_latency ();
|
const samplecnt_t l = effective_latency ();
|
||||||
if (_plugin_signal_latency != l) {
|
if (_plugin_signal_latency != l) {
|
||||||
|
@ -251,6 +251,7 @@ Session::run_click (samplepos_t start, samplepos_t nframes)
|
|||||||
|
|
||||||
_click_gain->run (bufs, 0, 0, 1.0, nframes, false);
|
_click_gain->run (bufs, 0, 0, 1.0, nframes, false);
|
||||||
_click_io->copy_to_outputs (bufs, DataType::AUDIO, nframes, 0);
|
_click_io->copy_to_outputs (bufs, DataType::AUDIO, nframes, 0);
|
||||||
|
_click_io->flush_buffers (nframes);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
Loading…
Reference in New Issue
Block a user