still do cycle_start() & cycle_end() calls when freewheeling
authorPaul Davis <paul@linuxaudiosystems.com>
Tue, 3 Jun 2008 12:14:59 +0000 (12:14 +0000)
committerPaul Davis <paul@linuxaudiosystems.com>
Tue, 3 Jun 2008 12:14:59 +0000 (12:14 +0000)
git-svn-id: svn://localhost/ardour2/branches/3.0@3440 d708f5d6-7413-0410-9779-e7cbd77b26cf

libs/ardour/audioengine.cc

index 8bbed4673346229158aaaf8d7fb98238e2fab53f..a3f5eb9fd11e3090ab8a71655e4f893b850eaa9a 100644 (file)
@@ -321,6 +321,13 @@ AudioEngine::process_callback (nframes_t nframes)
                return 0;
        }
 
+       boost::shared_ptr<Ports> p = ports.reader();
+
+       // Prepare ports (ie read data if necessary)
+       for (Ports::iterator i = p->begin(); i != p->end(); ++i) {
+               (*i)->cycle_start (nframes, 0);
+       }
+
        if (_freewheeling) {
                /* emit the Freewheel signal and stop freewheeling in the event of trouble */
                if (Freewheel (nframes)) {
@@ -328,18 +335,11 @@ AudioEngine::process_callback (nframes_t nframes)
                        _freewheeling = false;
                        jack_set_freewheel (_jack, false);
                }
-               return 0;
-       }
 
-       boost::shared_ptr<Ports> p = ports.reader();
-
-       // Prepare ports (ie read data if necessary)
-       for (Ports::iterator i = p->begin(); i != p->end(); ++i) {
-               (*i)->cycle_start (nframes, 0);
-       }
-       
-       if (session) {
-               session->process (nframes);
+       } else {
+               if (session) {
+                       session->process (nframes);
+               }
        }
        
        // Finalize ports (ie write data if necessary)
@@ -348,6 +348,10 @@ AudioEngine::process_callback (nframes_t nframes)
                (*i)->cycle_end (nframes, 0);
        }
 
+       if (_freewheeling) {
+               return 0;
+       }
+
        if (!_running) {
                _processed_frames = next_processed_frames;
                return 0;