diff plugin/DSSIPluginInstance.cpp @ 242:2f7d27648806

* Fix real-time plugin corruption when getLatency is called for some plugins * Other minor changes
author Chris Cannam
date Thu, 01 Mar 2007 15:35:27 +0000
parents 71f869dac40b
children dc46851837d6
line wrap: on
line diff
--- a/plugin/DSSIPluginInstance.cpp	Thu Mar 01 12:15:08 2007 +0000
+++ b/plugin/DSSIPluginInstance.cpp	Thu Mar 01 15:35:27 2007 +0000
@@ -268,7 +268,14 @@
 #endif
 
     if (m_latencyPort) {
-	if (!m_run) run(Vamp::RealTime::zeroTime);
+	if (!m_run) {
+            for (int i = 0; i < getAudioInputCount(); ++i) {
+                for (int j = 0; j < m_blockSize; ++j) {
+                    m_inputBuffers[i][j] = 0.f;
+                }
+            }
+            run(Vamp::RealTime::zeroTime);
+        }
 	latency = (size_t)(*m_latencyPort + 0.1);
     }