From 64ed049567c0712eb473ff77b9ee717d5232487d Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Sun, 27 Jan 2019 14:02:03 -0700 Subject: force execution of ARDOUR::init_post_engine() before any handlers of AudioEngine::Running() --- libs/ardour/audioengine.cc | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'libs/ardour/audioengine.cc') diff --git a/libs/ardour/audioengine.cc b/libs/ardour/audioengine.cc index 3fbc7635e1..612a3fd0e0 100644 --- a/libs/ardour/audioengine.cc +++ b/libs/ardour/audioengine.cc @@ -39,6 +39,7 @@ #include "midi++/mmc.h" #include "ardour/async_midi_port.h" +#include "ardour/ardour.h" #include "ardour/audio_port.h" #include "ardour/audio_backend.h" #include "ardour/audioengine.h" @@ -930,10 +931,22 @@ AudioEngine::start (bool for_latency) PortManager::fill_midi_port_info (); if (!for_latency) { + /* Call the library-wide ::init_post_engine() before emitting + * running to ensure that its tasks are complete before any + * signal handlers execute. PBD::Signal does not ensure + * ordering of signal handlers so even if ::init_post_engine() + * is connected first, it may not run first. + */ + + ARDOUR::init_post_engine (_start_cnt); + Running (_start_cnt); /* EMIT SIGNAL */ + + /* latency start/stop cycles do not count as "starts" */ + + _start_cnt++; } - _start_cnt++; return 0; } -- cgit v1.2.3