+ if (_latency_detect) {
+
+ if (_input->n_ports().n_audio() != 0) {
+
+ AudioBuffer& outbuf (_output->ports().nth_audio_port(0)->get_audio_buffer (nframes));
+ Sample* in = _input->ports().nth_audio_port(0)->get_audio_buffer (nframes).data();
+ Sample* out = outbuf.data();
+
+ _mtdm->process (nframes, in, out);
+
+ outbuf.is_silent (false);
+ }
+
+ return;
+
+ } else if (_latency_flush_frames) {
+
+ /* wait for the entire input buffer to drain before picking up input again so that we can't
+ hear the remnants of whatever MTDM pumped into the pipeline.
+ */
+
+ silence (nframes);
+
+ if (_latency_flush_frames > nframes) {
+ _latency_flush_frames -= nframes;
+ } else {
+ _latency_flush_frames = 0;
+ }
+
+ return;
+ }
+