Tweak transmission of MMC on locate. Should fix #3121.
[ardour.git] / libs / ardour / session_export.cc
index ea215e6058c47ee28caefccbed30a1da1709d8cb..75c8fd0dd75404d53d3beaa37bd405122334210a 100644 (file)
 #include "pbd/error.h"
 #include <glibmm/thread.h>
 
-#include "ardour/audio_diskstream.h"
 #include "ardour/audioengine.h"
 #include "ardour/butler.h"
 #include "ardour/export_failed.h"
 #include "ardour/export_handler.h"
 #include "ardour/export_status.h"
-#include "ardour/route.h"
 #include "ardour/session.h"
+#include "ardour/track.h"
+#include "ardour/process_thread.h"
 
 #include "i18n.h"
 
@@ -105,10 +105,11 @@ Session::start_audio_export (nframes_t position, bool /* realtime */)
        /* get everyone to the right position */
 
        {
-               boost::shared_ptr<DiskstreamList> dsl = diskstreams.reader();
+               boost::shared_ptr<RouteList> rl = routes.reader();
 
-               for (DiskstreamList::iterator i = dsl->begin(); i != dsl->end(); ++i) {
-                       if ((*i)-> seek (position, true)) {
+               for (RouteList::iterator i = rl->begin(); i != rl->end(); ++i) {
+                       boost::shared_ptr<Track> tr = boost::dynamic_pointer_cast<Track> (*i);
+                       if (tr && tr->seek (position, true)) {
                                error << string_compose (_("%1: cannot seek to %2 for export"),
                                                  (*i)->name(), position)
                                      << endmsg;
@@ -179,7 +180,9 @@ Session::process_export (nframes_t nframes)
 int
 Session::process_export_fw (nframes_t nframes)
 {
+        _engine.main_thread()->get_buffers ();
        process_export (nframes);
+        _engine.main_thread()->drop_buffers ();
        return 0;
 }
 
@@ -221,6 +224,6 @@ Session::finalize_audio_export ()
        if (post_export_sync) {
                config.set_external_sync (true);
        } else {
-               locate (post_export_position, false, false, false);
+               locate (post_export_position, false, false, false, false, false);
        }
 }