From 78b29c55d3c4f056bbdd23354ee8390d769c67da Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Fri, 10 Apr 2020 03:29:16 +0200 Subject: Hotfix more export woes, prevent possible endless loop This apparently happens on some Windows systems when exporting a range starting at 00:00:00:00 I'm still hoping there's a better fix for these race-condition issues, perhaps by kicking the TFSM... --- libs/ardour/session_export.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'libs/ardour/session_export.cc') diff --git a/libs/ardour/session_export.cc b/libs/ardour/session_export.cc index 0c8811a969..cb74b8cfe6 100644 --- a/libs/ardour/session_export.cc +++ b/libs/ardour/session_export.cc @@ -139,10 +139,16 @@ Session::start_audio_export (samplepos_t position, bool realtime, bool region_ex * to wait for it to wake up and call * non_realtime_stop (). */ + int timeout = std::max (10, (int)(nominal_sample_rate () / get_block_size ())); do { Glib::usleep (engine().usecs_per_cycle ()); _butler->schedule_transport_work (); - } while (0 != post_transport_work ()); + } while (0 != post_transport_work () && --timeout > 0); + + if (timeout != 0) { + error << _("Cannot prepare transport for export") << endmsg; + return -1; + } /* We're about to call Track::seek, so the butler must have finished everything up otherwise it could be doing do_refill in its thread while we are doing -- cgit v1.2.3