Merge branch 'master' into cairocanvas
[ardour.git] / libs / ardour / port_insert.cc
index b2758b2d57249353dd7755d4c4b4df9b1ca10dc6..fa09ea05ac8dd11e3b2f2358ebed1b5eb4e81b66 100644 (file)
@@ -49,7 +49,7 @@ PortInsert::PortInsert (Session& s, boost::shared_ptr<Pannable> pannable, boost:
 {
         _mtdm = 0;
         _latency_detect = false;
-        _latency_flush_frames = false;
+        _latency_flush_frames = 0;
         _measured_latency = 0;
 }
 
@@ -64,7 +64,7 @@ PortInsert::start_latency_detection ()
 {
        delete _mtdm;
         _mtdm = new MTDM (_session.frame_rate());
-        _latency_flush_frames = false;
+        _latency_flush_frames = 0;
         _latency_detect = true;
         _measured_latency = 0;
 }
@@ -72,7 +72,7 @@ PortInsert::start_latency_detection ()
 void
 PortInsert::stop_latency_detection ()
 {
-        _latency_flush_frames = signal_latency() + _session.engine().frames_per_cycle();
+        _latency_flush_frames = signal_latency() + _session.engine().samples_per_cycle();
         _latency_detect = false;
 }
 
@@ -93,7 +93,7 @@ PortInsert::latency() const
        */
 
        if (_measured_latency == 0) {
-               return _session.engine().frames_per_cycle() + _input->latency();
+               return _session.engine().samples_per_cycle() + _input->latency();
        } else {
                return _measured_latency;
        }
@@ -116,7 +116,6 @@ PortInsert::run (BufferSet& bufs, framepos_t start_frame, framepos_t end_frame,
 
                         _mtdm->process (nframes, in, out);
                        
-                        outbuf.set_is_silent (false);
                         outbuf.set_written (true);
                 }
 
@@ -240,7 +239,7 @@ PortInsert::signal_latency() const
        */
 
         if (_measured_latency == 0) {
-                return _session.engine().frames_per_cycle() + _input->signal_latency();
+                return _session.engine().samples_per_cycle() + _input->signal_latency();
         } else {
                 return _measured_latency;
         }