From: Paul Davis Date: Wed, 17 Oct 2012 22:33:02 +0000 (+0000) Subject: patch from robin to fix where the transport start occurs when exporting (#4098) X-Git-Tag: 3.0~747 X-Git-Url: https://main.carlh.net/gitweb/?a=commitdiff_plain;h=aa3fe77d7f2618838c165b1dceb4632ccf867b52;hp=97eb00274f8d4ba17743eddbf6c03b25bd508213;p=ardour.git patch from robin to fix where the transport start occurs when exporting (#4098) git-svn-id: svn://localhost/ardour2/branches/3.0@13305 d708f5d6-7413-0410-9779-e7cbd77b26cf --- diff --git a/libs/ardour/ardour/session.h b/libs/ardour/ardour/session.h index 5e1245294b..df04971e02 100644 --- a/libs/ardour/ardour/session.h +++ b/libs/ardour/ardour/session.h @@ -964,6 +964,7 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi framepos_t post_export_position; bool _exporting; + bool _export_started; bool _export_rolling; boost::shared_ptr export_handler; diff --git a/libs/ardour/session_export.cc b/libs/ardour/session_export.cc index 1c1b4f9a0f..969f4bb609 100644 --- a/libs/ardour/session_export.cc +++ b/libs/ardour/session_export.cc @@ -106,6 +106,7 @@ Session::start_audio_export (framepos_t position) { if (!_exporting) { pre_export (); + _export_started = false; } /* We're about to call Track::seek, so the butler must have finished everything @@ -145,11 +146,6 @@ Session::start_audio_export (framepos_t position) since then has re-awakened it. */ - set_transport_speed (1.0, false); - butler_transport_work (); - g_atomic_int_set (&_butler->should_do_transport_work, 0); - post_transport (); - /* we are ready to go ... */ if (!_engine.connected()) { @@ -193,6 +189,16 @@ Session::process_export (pframes_t nframes) int Session::process_export_fw (pframes_t nframes) { + + if (!_export_started) { + _export_started=true; + set_transport_speed (1.0, false); + butler_transport_work (); + g_atomic_int_set (&_butler->should_do_transport_work, 0); + post_transport (); + return 0; + } + _engine.main_thread()->get_buffers (); process_export (nframes); _engine.main_thread()->drop_buffers ();