patch from robin to fix where the transport start occurs when exporting (#4098)
authorPaul Davis <paul@linuxaudiosystems.com>
Wed, 17 Oct 2012 22:33:02 +0000 (22:33 +0000)
committerPaul Davis <paul@linuxaudiosystems.com>
Wed, 17 Oct 2012 22:33:02 +0000 (22:33 +0000)
git-svn-id: svn://localhost/ardour2/branches/3.0@13305 d708f5d6-7413-0410-9779-e7cbd77b26cf

libs/ardour/ardour/session.h
libs/ardour/session_export.cc

index 5e1245294b4137b59ebd489b71599bcc1666bc00..df04971e02583a82895780eeeea073bab7623695 100644 (file)
@@ -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<ExportHandler> export_handler;
index 1c1b4f9a0f1acd7831c3b6fd1f060c26c5f9afb6..969f4bb609d81d76ef970962b9faa5fae36e4c07 100644 (file)
@@ -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 ();