From 1316fe66010c520e2dbd724c1f95f2f5ad63345a Mon Sep 17 00:00:00 2001 From: nick_m Date: Mon, 30 May 2016 01:23:19 +1000 Subject: [PATCH] Make TempoMap::framewalk_to_beats () more correct. --- libs/ardour/tempo.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libs/ardour/tempo.cc b/libs/ardour/tempo.cc index 1f0d9395d5..6d83ebdc50 100644 --- a/libs/ardour/tempo.cc +++ b/libs/ardour/tempo.cc @@ -3571,7 +3571,9 @@ TempoMap::framepos_plus_bbt (framepos_t pos, BBT_Time op) const Evoral::Beats TempoMap::framewalk_to_beats (framepos_t pos, framecnt_t distance) const { - return Evoral::Beats (beat_at_frame (pos + distance) - beat_at_frame (pos)); + Glib::Threads::RWLock::ReaderLock lm (lock); + + return Evoral::Beats (beat_at_frame_locked (_metrics, pos + distance) - beat_at_frame_locked (_metrics, pos)); } struct bbtcmp {