diff options
Diffstat (limited to 'libs')
-rw-r--r-- | libs/ardour/ardour/slave.h | 1 | ||||
-rw-r--r-- | libs/ardour/ltc_slave.cc | 16 | ||||
-rw-r--r-- | libs/ardour/session_ltc.cc | 7 |
3 files changed, 19 insertions, 5 deletions
diff --git a/libs/ardour/ardour/slave.h b/libs/ardour/ardour/slave.h index f864bee636..48d9ac5162 100644 --- a/libs/ardour/ardour/slave.h +++ b/libs/ardour/ardour/slave.h @@ -356,6 +356,7 @@ public: bool detect_ltc_fps(int, bool); bool equal_ltc_frame_time(LTCFrame *a, LTCFrame *b); void reset(); + void resync_xrun(); void resync_latency(); Session& session; diff --git a/libs/ardour/ltc_slave.cc b/libs/ardour/ltc_slave.cc index 4f6f77ce1f..f176c206a3 100644 --- a/libs/ardour/ltc_slave.cc +++ b/libs/ardour/ltc_slave.cc @@ -61,7 +61,8 @@ LTC_Slave::LTC_Slave (Session& s) decoder = ltc_decoder_create((int) frames_per_ltc_frame, 128 /*queue size*/); reset(); - session.Xrun.connect_same_thread (port_connections, boost::bind (<C_Slave::resync_latency, this)); + resync_latency(); + session.Xrun.connect_same_thread (port_connections, boost::bind (<C_Slave::resync_xrun, this)); session.engine().GraphReordered.connect_same_thread (port_connections, boost::bind (<C_Slave::resync_latency, this)); } @@ -95,9 +96,16 @@ LTC_Slave::ok() const } void +LTC_Slave::resync_xrun() +{ + DEBUG_TRACE (DEBUG::LTC, "LTC resync_xrun()\n"); + engine_dll_initstate = 0; +} + +void LTC_Slave::resync_latency() { - DEBUG_TRACE (DEBUG::LTC, "LTC resync()\n"); + DEBUG_TRACE (DEBUG::LTC, "LTC resync_latency()\n"); engine_dll_initstate = 0; if (session.ltc_output_io()) { /* check if Port exits */ @@ -115,7 +123,6 @@ LTC_Slave::reset() transport_direction = 0; ltc_speed = 0; engine_dll_initstate = 0; - resync_latency(); } void @@ -378,6 +385,9 @@ LTC_Slave::speed_and_position (double& speed, framepos_t& pos) * ..but first fix jack2 issue with re-computing latency * in the correct order. Until then, querying it in the * process-callback is the only way to get the current value + * + * update: fix for this issue is known -- common/JackEngine.cpp + * but not yet applied to jack2 git. */ ltcport->get_connected_latency_range(ltc_slave_latency, false); #endif diff --git a/libs/ardour/session_ltc.cc b/libs/ardour/session_ltc.cc index b7044d28a4..d14756c0ba 100644 --- a/libs/ardour/session_ltc.cc +++ b/libs/ardour/session_ltc.cc @@ -58,7 +58,8 @@ Session::ltc_tx_initialize() ltc_enc_buf = (ltcsnd_sample_t*) calloc((nominal_frame_rate() / 23), sizeof(ltcsnd_sample_t)); ltc_speed = 0; ltc_tx_reset(); - Xrun.connect_same_thread (*this, boost::bind (&Session::ltc_tx_resync_latency, this)); + ltc_tx_resync_latency(); + Xrun.connect_same_thread (*this, boost::bind (&Session::ltc_tx_reset, this)); engine().GraphReordered.connect_same_thread (*this, boost::bind (&Session::ltc_tx_resync_latency, this)); } @@ -92,7 +93,6 @@ Session::ltc_tx_reset() ltc_buf_off = 0; ltc_enc_byte = 0; ltc_enc_cnt = 0; - ltc_tx_resync_latency(); } void @@ -160,6 +160,9 @@ Session::ltc_tx_send_time_code_for_cycle (framepos_t start_frame, framepos_t end * ..but first fix jack2 issue with re-computing latency * in the correct order. Until then, querying it in the * process-callback is the only way to get the current value + * + * update: fix for this issue is known -- common/JackEngine.cpp + * but not yet applied to jack2 git. */ ltcport->get_connected_latency_range(ltc_out_latency, true); #endif |