From ee87b068e8847331a48a5e481fd973abde2660f3 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Tue, 30 Apr 2024 01:54:33 +0200 Subject: [PATCH] Move RegionFx ThreadBuffers to Butler thread --- libs/ardour/audioregion.cc | 5 ----- libs/ardour/butler.cc | 7 ++++++- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/libs/ardour/audioregion.cc b/libs/ardour/audioregion.cc index f172143547..6944e05bca 100644 --- a/libs/ardour/audioregion.cc +++ b/libs/ardour/audioregion.cc @@ -2430,9 +2430,6 @@ AudioRegion::apply_region_fx (BufferSet& bufs, samplepos_t start_sample, samplep } } - ARDOUR::ProcessThread* pt = new ProcessThread (); // TODO -> move to butler ? - pt->get_buffers (); - samplecnt_t latency_offset = 0; for (auto const& rfx : _plugins) { @@ -2470,6 +2467,4 @@ AudioRegion::apply_region_fx (BufferSet& bufs, samplepos_t start_sample, samplep } _fx_pos = end_sample; _fx_latent_read = false; - pt->drop_buffers (); - delete pt; } diff --git a/libs/ardour/butler.cc b/libs/ardour/butler.cc index 8c76c9b084..039d1aef00 100644 --- a/libs/ardour/butler.cc +++ b/libs/ardour/butler.cc @@ -172,7 +172,12 @@ Butler::_thread_work (void* arg) { SessionEvent::create_per_thread_pool ("butler events", 4096); pthread_set_name (X_("butler")); - return ((Butler*)arg)->thread_work (); + ARDOUR::ProcessThread* pt = new ProcessThread (); + pt->get_buffers (); + void* rv = ((Butler*)arg)->thread_work (); + pt->drop_buffers (); + delete pt; + return rv; } void*