more MTC debugging
[ardour.git] / libs / ardour / track.cc
index 373829413ceaa336003f3741c1ffa77c32910f60..1aa917ca9d0830a9e93ba9eb8c5af95aae95d6e6 100644 (file)
@@ -16,9 +16,6 @@
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */
 #include "pbd/error.h"
-#include <sigc++/retype.h>
-#include <sigc++/retype_return.h>
-#include <sigc++/bind.h>
 
 #include "ardour/amp.h"
 #include "ardour/audioplaylist.h"
@@ -250,11 +247,18 @@ Track::no_roll (nframes_t nframes, sframes_t start_frame, sframes_t end_frame,
        }
 
        if (session_state_changing) {
+               if (_session.transport_speed() != 0.0f) {
+                       /* we're rolling but some state is changing (e.g. our diskstream contents)
+                          so we cannot use them. Be silent till this is over. Don't declick.
 
-               /* XXX is this safe to do against transport state changes? */
-
-               passthru_silence (start_frame, end_frame, nframes, 0);
-               return 0;
+                          XXX note the absurdity of ::no_roll() being called when we ARE rolling!
+                       */
+                       passthru_silence (start_frame, end_frame, nframes, 0);
+                       return 0;
+               }
+               /* we're really not rolling, so we're either delivery silence or actually
+                  monitoring, both of which are safe to do while session_state_changing is true.
+               */
        }
 
        diskstream()->check_record_status (start_frame, nframes, can_record);