diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2012-01-05 05:05:31 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2012-01-05 05:05:31 +0000 |
commit | e0b694f630e31039e082c1ce640dfaf85bfede3c (patch) | |
tree | 13eae2b01c2ea916199f7930afe9789a0cedf825 /libs/ardour/session_time.cc | |
parent | 4e4306d1251aedc294ae8e041f855d136f1c7e8f (diff) |
possibly fix deadlocking issues with tempo map by rearranging code and adding RT variants for a couple of functions that would normally try to rebuild the map when necessary; instead the variants throw an exception and the RT code that called them tries to do something reasonable
git-svn-id: svn://localhost/ardour2/branches/3.0@11164 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/session_time.cc')
-rw-r--r-- | libs/ardour/session_time.cc | 35 |
1 files changed, 20 insertions, 15 deletions
diff --git a/libs/ardour/session_time.cc b/libs/ardour/session_time.cc index bf7a43845b..38eb0b4b28 100644 --- a/libs/ardour/session_time.cc +++ b/libs/ardour/session_time.cc @@ -485,20 +485,25 @@ Session::jack_timebase_callback (jack_transport_state_t /*state*/, TempoMetric metric (_tempo_map->metric_at (_transport_frame)); - _tempo_map->bbt_time (_transport_frame, bbt); - - pos->bar = bbt.bars; - pos->beat = bbt.beats; - pos->tick = bbt.ticks; - - // XXX still need to set bar_start_tick - - pos->beats_per_bar = metric.meter().divisions_per_bar(); - pos->beat_type = metric.meter().note_divisor(); - pos->ticks_per_beat = Timecode::BBT_Time::ticks_per_bar_division; - pos->beats_per_minute = metric.tempo().beats_per_minute(); - - pos->valid = jack_position_bits_t (pos->valid | JackPositionBBT); + try { + _tempo_map->bbt_time_rt (_transport_frame, bbt); + + pos->bar = bbt.bars; + pos->beat = bbt.beats; + pos->tick = bbt.ticks; + + // XXX still need to set bar_start_tick + + pos->beats_per_bar = metric.meter().divisions_per_bar(); + pos->beat_type = metric.meter().note_divisor(); + pos->ticks_per_beat = Timecode::BBT_Time::ticks_per_bar_division; + pos->beats_per_minute = metric.tempo().beats_per_minute(); + + pos->valid = jack_position_bits_t (pos->valid | JackPositionBBT); + + } catch (...) { + warning << _("failed to set tempo map information for JACK due to issues with tempo map") << endmsg; + } } #ifdef HAVE_JACK_VIDEO_SUPPORT @@ -554,7 +559,7 @@ Session::convert_to_frames (AnyTime const & position) switch (position.type) { case AnyTime::BBT: - return _tempo_map->frame_time (position.bbt); + return _tempo_map->frame_time_rt (position.bbt); break; case AnyTime::Timecode: |