From 100ee72cec28863efddb3d8089de36affeda6e1e Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Fri, 3 May 2024 14:44:49 +0200 Subject: [PATCH] Fix copying RegionFx Automation --- libs/ardour/region_fx_plugin.cc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/libs/ardour/region_fx_plugin.cc b/libs/ardour/region_fx_plugin.cc index dab9dab7b2..ed5ec43f9d 100644 --- a/libs/ardour/region_fx_plugin.cc +++ b/libs/ardour/region_fx_plugin.cc @@ -355,9 +355,12 @@ RegionFxPlugin::set_default_automation (timepos_t end) { for (auto const& i : _controls) { std::shared_ptr ac = std::dynamic_pointer_cast (i.second); - assert (ac->alist ()->empty ()); - ac->alist ()->fast_simple_add (timepos_t (time_domain ()), ac->normal ()); - ac->alist ()->fast_simple_add (end, ac->normal ()); + if (ac->alist ()->empty ()) { + ac->alist ()->fast_simple_add (timepos_t (time_domain ()), ac->normal ()); + ac->alist ()->fast_simple_add (end, ac->normal ()); + } else { + ac->alist ()->truncate_end (end); + } } }