From 031a05b07a56601521ba6b25b415e32a870b2326 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Tue, 1 Feb 2022 21:39:55 +0100 Subject: [PATCH] Return early if processing is blocked There is no need to setup thread-local variable if they are never used. --- libs/ardour/session_process.cc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/libs/ardour/session_process.cc b/libs/ardour/session_process.cc index cb923e9e3c..b06439fe8a 100644 --- a/libs/ardour/session_process.cc +++ b/libs/ardour/session_process.cc @@ -85,17 +85,17 @@ Session::process (pframes_t nframes) { TimerRAII tr (dsp_stats[OverallProcess]); - samplepos_t transport_at_start = _transport_sample; - - setup_thread_local_variables (); - - _silent = false; - if (processing_blocked()) { _silent = true; return; + } else { + _silent = false; } + samplepos_t transport_at_start = _transport_sample; + + setup_thread_local_variables (); + if (non_realtime_work_pending()) { DEBUG_TRACE (DEBUG::Butler, string_compose ("non-realtime work pending: %1 (%2%3%4)\n", enum_2_string (post_transport_work()), std::hex, post_transport_work(), std::dec)); if (!_butler->transport_work_requested ()) {