triggers/graph: fix location of calls to TempoMap::fetch()

This ensures that RT graph threads have the correct tempo map,
and thus run triggers correctly when timestretch is required.
This commit is contained in:
Paul Davis 2022-10-27 16:33:46 -06:00
parent b195a04281
commit bd33971346

View file

@ -227,6 +227,8 @@ Graph::prep ()
g_atomic_int_inc (&_trigger_queue_size); g_atomic_int_inc (&_trigger_queue_size);
_trigger_queue.push_back (i.get ()); _trigger_queue.push_back (i.get ());
} }
Temporal::TempoMap::fetch();
} }
void void
@ -323,8 +325,6 @@ Graph::run_one ()
/* update the thread-local tempo map ptr */ /* update the thread-local tempo map ptr */
Temporal::TempoMap::fetch ();
if (g_atomic_int_get (&_terminate)) { if (g_atomic_int_get (&_terminate)) {
return; return;
} }
@ -337,6 +337,8 @@ Graph::run_one ()
_trigger_queue.pop_front (to_run); _trigger_queue.pop_front (to_run);
} }
Temporal::TempoMap::fetch ();
/* Process the graph-node */ /* Process the graph-node */
g_atomic_int_dec_and_test (&_trigger_queue_size); g_atomic_int_dec_and_test (&_trigger_queue_size);
to_run->run (_graph_chain); to_run->run (_graph_chain);
@ -366,9 +368,6 @@ Graph::helper_thread ()
pt->get_buffers (); pt->get_buffers ();
/* just in case we need the thread local tempo map ptr before anything else */
Temporal::TempoMap::fetch ();
while (!g_atomic_int_get (&_terminate)) { while (!g_atomic_int_get (&_terminate)) {
run_one (); run_one ();
} }
@ -402,7 +401,6 @@ Graph::main_thread ()
/* Wait for initial process callback */ /* Wait for initial process callback */
again: again:
_callback_start_sem.wait (); _callback_start_sem.wait ();
Temporal::TempoMap::fetch ();
DEBUG_TRACE (DEBUG::ProcessThreads, "main thread is awake\n"); DEBUG_TRACE (DEBUG::ProcessThreads, "main thread is awake\n");