From d3eab4e3092755710ceb863476fb934e955b1fc4 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Wed, 11 Nov 2020 18:48:51 +0100 Subject: [PATCH] Prevent duplicate meters when importing tempo-map #8449 The file linked from the bug report has a meter-change in the middle of a bar. Ardour maps this back to the previous bar, which already has a meter-change. Session load fails with "Multiple meter definitions found at 473" The tempo-map of the file ends like this: ``` Meter 11/32 @227040 (beat 473) Meter 4 / 4 @227680 (beat 483.666667) ``` --- libs/ardour/tempo.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libs/ardour/tempo.cc b/libs/ardour/tempo.cc index a7a51bd7d4..aa45372f6d 100644 --- a/libs/ardour/tempo.cc +++ b/libs/ardour/tempo.cc @@ -1231,8 +1231,9 @@ TempoMap::add_meter_locked (const Meter& meter, const BBT_Time& bbt, samplepos_t if (!solved && recompute) { /* if this has failed to solve, there is little we can do other than to ensure that - the new map is recalculated. - */ + * the new map is valid and recalculated. + */ + remove_meter_locked (*new_meter); warning << "Adding meter may have left the tempo map unsolved." << endmsg; recompute_map (_metrics); }