summaryrefslogtreecommitdiff
path: root/libs/ardour/session_ltc.cc
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2017-08-01 17:48:42 +0200
committerRobin Gareus <robin@gareus.org>2017-08-01 17:48:42 +0200
commit9694986a85da8e7d18e9003e3706939bf4e34097 (patch)
treec1339788e218a3489563a9da5f0d8c1c1c7ebcf6 /libs/ardour/session_ltc.cc
parent79dc3882ea6dfd5ce2e1bf47e26ec98d2b8b2486 (diff)
Fix LTC encoder removal
Fixed a crash if an x-run or graph-reorder happens after the LTC encoder has been destroyed (possible at session-close or after disabling the encoder). This also fixes duplicate callbacks in case the encoder was re-enabled times in an active session.
Diffstat (limited to 'libs/ardour/session_ltc.cc')
-rw-r--r--libs/ardour/session_ltc.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/libs/ardour/session_ltc.cc b/libs/ardour/session_ltc.cc
index 51a39d0677..87fd47e70e 100644
--- a/libs/ardour/session_ltc.cc
+++ b/libs/ardour/session_ltc.cc
@@ -84,8 +84,8 @@ Session::ltc_tx_initialize()
ltc_prev_cycle = -1;
ltc_tx_reset();
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));
+ 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));
restarting = false;
}
@@ -97,6 +97,7 @@ Session::ltc_tx_cleanup()
ltc_enc_buf = NULL;
ltc_encoder_free(ltc_encoder);
ltc_encoder = NULL;
+ ltc_tx_connections.drop_connections ();
}
void
@@ -115,6 +116,7 @@ void
Session::ltc_tx_reset()
{
DEBUG_TRACE (DEBUG::LTC, "LTC TX reset\n");
+ assert (ltc_encoder);
ltc_enc_pos = -9999; // force re-start
ltc_buf_len = 0;
ltc_buf_off = 0;