From ace8a0d7b921ad835e1c2500a9a568c29e3d0fab Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Sat, 9 May 2020 00:33:59 +0200 Subject: LTC Generator: prefer LatencyUpdated signal --- libs/ardour/session_ltc.cc | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'libs/ardour/session_ltc.cc') diff --git a/libs/ardour/session_ltc.cc b/libs/ardour/session_ltc.cc index 26e16047cb..5c3da63f17 100644 --- a/libs/ardour/session_ltc.cc +++ b/libs/ardour/session_ltc.cc @@ -84,9 +84,9 @@ Session::ltc_tx_initialize() ltc_speed = 0; ltc_prev_cycle = -1; ltc_tx_reset(); - ltc_tx_resync_latency(); + ltc_tx_resync_latency (true); Xrun.connect_same_thread (ltc_tx_connections, boost::bind (&Session::ltc_tx_reset, this)); - engine().GraphReordered.connect_same_thread (ltc_tx_connections, boost::bind (&Session::ltc_tx_resync_latency, this)); + LatencyUpdated.connect_same_thread (ltc_tx_connections, boost::bind (&Session::ltc_tx_resync_latency, this, _1)); restarting = false; } @@ -102,14 +102,15 @@ Session::ltc_tx_cleanup() } void -Session::ltc_tx_resync_latency() +Session::ltc_tx_resync_latency (bool playback) { + if (deletion_in_progress() || !playback) { + return; + } DEBUG_TRACE (DEBUG::TXLTC, "resync latency\n"); - if (!deletion_in_progress()) { - boost::shared_ptr ltcport = ltc_output_port(); - if (ltcport) { - ltcport->get_connected_latency_range(ltc_out_latency, true); - } + boost::shared_ptr ltcport = ltc_output_port(); + if (ltcport) { + ltcport->get_connected_latency_range(ltc_out_latency, true); } } -- cgit v1.2.3