diff options
author | Robin Gareus <robin@gareus.org> | 2020-04-10 03:29:16 +0200 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2020-04-10 03:29:16 +0200 |
commit | 78b29c55d3c4f056bbdd23354ee8390d769c67da (patch) | |
tree | d691a103262b4b57360077867d3ad41614a14444 /libs/ardour/session_export.cc | |
parent | c33c988adc909444d4a6995b66878b7ff9c553a7 (diff) |
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...
Diffstat (limited to 'libs/ardour/session_export.cc')
-rw-r--r-- | libs/ardour/session_export.cc | 8 |
1 files changed, 7 insertions, 1 deletions
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 |