summaryrefslogtreecommitdiff
path: root/libs/ardour/session_export.cc
diff options
context:
space:
mode:
Diffstat (limited to 'libs/ardour/session_export.cc')
-rw-r--r--libs/ardour/session_export.cc8
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