From ef2c1d990b6b9d84fa43e5e64c0ca14d60895b11 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Thu, 7 Jul 2022 18:28:27 +0200 Subject: [PATCH] Prevent accumulating events during freewheel export When exporting many ranges, locate and restarting transport for every ranged a SessionEvent::TransportStateChange event is queued. Since freewheel export does not process events. Those events can accumulate: https://discourse.ardour.org/t/pipewire-jack-export-freeze/107383/18?u=x42 During export those requests can be safely ignored because the only purpose is to emit a TransportStateChange() signal when the playhead passes a given location and notify the UI. --- libs/ardour/session_export.cc | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/libs/ardour/session_export.cc b/libs/ardour/session_export.cc index 3eadd6259c..123ca97285 100644 --- a/libs/ardour/session_export.cc +++ b/libs/ardour/session_export.cc @@ -346,6 +346,16 @@ Session::process_export_fw (pframes_t nframes) butler_completed_transport_work (); } + { + SessionEvent* ev; + while (pending_events.read (&ev, 1) == 1) { + merge_event (ev); + } + /* remove TransportStateChange events (which otherwise accumulate with each exported range) */ + ev = new SessionEvent (SessionEvent::TransportStateChange, SessionEvent::Clear, SessionEvent::Immediate, 0, 0); + merge_event (ev); + } + if (_remaining_latency_preroll > 0) { samplepos_t remain = std::min ((samplepos_t)nframes, _remaining_latency_preroll);