summaryrefslogtreecommitdiff
path: root/libs/ardour/session.cc
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2020-04-26 05:55:43 +0200
committerRobin Gareus <robin@gareus.org>2020-04-26 05:55:43 +0200
commit3785cbbf0376524a4a294fb7eb9d272d0a9c3251 (patch)
tree90f923f3b0befdbc1648f5d269e4c4b54ba1506d /libs/ardour/session.cc
parent0067a4596d4a08fc8c0bf94ed38a280003055b9d (diff)
Cont'd work on delayline-config (amend b196cef2)
Diffstat (limited to 'libs/ardour/session.cc')
-rw-r--r--libs/ardour/session.cc22
1 files changed, 5 insertions, 17 deletions
diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc
index 35e27ea123..9b6d027139 100644
--- a/libs/ardour/session.cc
+++ b/libs/ardour/session.cc
@@ -6483,14 +6483,9 @@ Session::send_latency_compensation_change ()
bool
Session::update_route_latency (bool playback, bool apply_to_delayline)
{
-#ifndef NDEBUG
- if (apply_to_delayline) {
- /* apply_to_delayline can no be called concurrently with processing */
- Glib::Threads::Mutex::Lock lm (AudioEngine::instance()->process_lock (), Glib::Threads::TRY_LOCK);
- /* Caller must hold process lock already */
- assert (!lm.locked ());
- }
-#endif
+ /* apply_to_delayline can no be called concurrently with processing
+ * caller must hold process lock when apply_to_delayline == true */
+ assert (!apply_to_delayline || !AudioEngine::instance()->process_lock().trylock());
/* Note: RouteList is process-graph sorted */
boost::shared_ptr<RouteList> r = routes.reader ();
@@ -6654,10 +6649,6 @@ Session::update_latency_compensation (bool force_whole_graph, bool called_from_b
return;
}
- if (_engine.in_process_thread ()) {
- called_from_backend = true;
- }
-
/* this lock is not usually contended, but under certain conditions,
* update_latency_compensation may be called concurrently.
* e.g. drag/drop copy a latent plugin while rolling.
@@ -6706,13 +6697,10 @@ Session::update_latency_compensation (bool force_whole_graph, bool called_from_b
DEBUG_TRACE (DEBUG::LatencyCompensation, "update_latency_compensation called from engine, don't call back into engine\n");
}
} else {
-
-#ifndef MIXBUS /* mixbus already has the process-locked */
+#ifndef MIXBUS
Glib::Threads::Mutex::Lock lm (AudioEngine::instance()->process_lock (), Glib::Threads::NOT_LOCK);
- if (!called_from_backend) {
- lm.acquire ();
- }
#endif
+ lm.acquire ();
DEBUG_TRACE (DEBUG::LatencyCompensation, "update_latency_compensation: directly apply to routes\n");
boost::shared_ptr<RouteList> r = routes.reader ();