13
0

Fix exporting multiple range (MacOS)

The actual issue was introduced in 61e7f3176b:
Session::non_realtime_stop() no longer unsets PostTransportStop
(other changes from that commit are not relevant).

The real issue however is a race-condition.
So far this only seems to happen on MacOS, Coreaudio.

It seems that non_realtime_stop() is called in the butler-thread
after exporting has started, even though the butler has been
paused in wait_until_finished().

Perhaps Coreaudio thread switches causes TransportFSM to
reinitialize and scheduling the butler?

The use of `usleep()` makes this rather a workaround.
However it's sufficient for the coreaudio rt thread to run
at least once.
This commit is contained in:
Robin Gareus 2020-04-08 06:26:47 +02:00
parent 911c82ff09
commit cfd95340b1
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04

View File

@ -23,6 +23,7 @@
#include "pbd/error.h"
#include <glibmm/threads.h>
#include <glibmm/timer.h>
#include <midi++/mmc.h>
@ -136,6 +137,8 @@ Session::start_audio_export (samplepos_t position, bool realtime, bool region_ex
it here.
*/
Glib::usleep (engine().usecs_per_cycle ());
_butler->schedule_transport_work ();
_butler->wait_until_finished ();
/* get everyone to the right position */