when a session goes away, deliver silence to all current ports to prevent a horrible...
authorPaul Davis <paul@linuxaudiosystems.com>
Wed, 20 Jun 2012 22:24:14 +0000 (22:24 +0000)
committerPaul Davis <paul@linuxaudiosystems.com>
Wed, 20 Jun 2012 22:24:14 +0000 (22:24 +0000)
git-svn-id: svn://localhost/ardour2/branches/3.0@12806 d708f5d6-7413-0410-9779-e7cbd77b26cf

libs/ardour/audioengine.cc

index 0f318a1b75b9ba1898ce7970ba9b46258e7162f3..26f8311c8d2625f751222e33a3a6a72fdf2578ed 100644 (file)
@@ -475,21 +475,30 @@ AudioEngine::process_callback (pframes_t nframes)
                return 0;
        }
 
+       if (session_remove_pending) {
+               /* perform the actual session removal */
+               _session = 0;
+               session_remove_pending = false;
+               session_removed.signal();
+       }
+
        if (_session == 0) {
                if (!_freewheeling) {
                        MIDI::Manager::instance()->cycle_start(nframes);
                        MIDI::Manager::instance()->cycle_end();
+
+                       boost::shared_ptr<Ports> p = ports.reader();
+                       
+                       for (Ports::iterator i = p->begin(); i != p->end(); ++i) {
+                               
+                               if (i->second->sends_output()) {
+                                       i->second->get_buffer (nframes).silence (nframes);
+                               }
+                       }
                }
-               _processed_frames = next_processed_frames;
-               return 0;
-       }
 
-       if (session_remove_pending) {
-               /* perform the actual session removal */
-               _session = 0;
-               session_remove_pending = false;
-               session_removed.signal();
                _processed_frames = next_processed_frames;
+
                return 0;
        }