From 180e90b81a839d72efca26993361cf4900a7cd9b Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Thu, 26 Sep 2024 03:44:09 +0200 Subject: [PATCH] Only call non_realtime_locate() when locating `butler_transport_work()` may be called for various reasons, notably PostTransportOverWrite. At that point in time the transport may still be rolling or stopping with rtloc already set. This can cause DR::Underruns since seek clear the entire disk reader buffer. --- libs/ardour/session_transport.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libs/ardour/session_transport.cc b/libs/ardour/session_transport.cc index de2989c98f..c751e3258b 100644 --- a/libs/ardour/session_transport.cc +++ b/libs/ardour/session_transport.cc @@ -1203,9 +1203,11 @@ Session::butler_transport_work (bool have_process_lock) } } - if (will_locate) { + if (will_locate && transport_locating ()) { DEBUG_TRACE (DEBUG::Butler, string_compose ("nonrealtime locate invoked from BTW (butler has done %1, rtlocs %2)\n", butler, rtlocates)); non_realtime_locate (); + } else if (will_locate) { + DEBUG_TRACE (DEBUG::Butler, string_compose ("skip nonrealtime locate (butler has done %1, rtlocs %2) ts = %3\n", butler, rtlocates, _transport_fsm->current_state())); } if (ptw & PostTransportOverWrite) {