diff src/vamp-hostsdk/PluginInputDomainAdapter.cpp @ 435:27c3448df198 vampipe

Fix m_ri initialisation
author Chris Cannam
date Tue, 16 Aug 2016 16:37:57 +0100
parents e979a9c4ffb6
children 7bab0c5422f4
line wrap: on
line diff
--- a/src/vamp-hostsdk/PluginInputDomainAdapter.cpp	Tue Aug 16 16:04:09 2016 +0100
+++ b/src/vamp-hostsdk/PluginInputDomainAdapter.cpp	Tue Aug 16 16:37:57 2016 +0100
@@ -234,10 +234,12 @@
             delete[] m_freqbuf[c];
         }
         delete[] m_freqbuf;
+        delete[] m_ri;
         if (m_cfg) {
             KissSingle::kiss_fftr_free(m_cfg);
+            m_cfg = 0;
             delete[] m_cbuf;
-            m_cfg = 0;
+            m_cbuf = 0;
         }
         delete m_window;
     }
@@ -275,10 +277,12 @@
             delete[] m_freqbuf[c];
         }
         delete[] m_freqbuf;
+        delete[] m_ri;
         if (m_cfg) {
             KissSingle::kiss_fftr_free(m_cfg);
+            m_cfg = 0;
             delete[] m_cbuf;
-            m_cfg = 0;
+            m_cbuf = 0;
         }
         delete m_window;
     }
@@ -291,15 +295,16 @@
     for (int c = 0; c < m_channels; ++c) {
         m_freqbuf[c] = new float[m_blockSize + 2];
     }
+    m_ri = new float[m_blockSize];
 
     m_window = new Window<float>(convertType(m_windowType), m_blockSize);
 
-    m_cfg = KissSingle::kiss_fftr_alloc(blockSize, false, 0, 0);
-    m_cbuf = new KissSingle::kiss_fft_cpx[blockSize/2+1];
+    m_cfg = KissSingle::kiss_fftr_alloc(m_blockSize, false, 0, 0);
+    m_cbuf = new KissSingle::kiss_fft_cpx[m_blockSize/2+1];
 
     m_processCount = 0;
 
-    return m_plugin->initialise(channels, stepSize, blockSize);
+    return m_plugin->initialise(channels, stepSize, m_blockSize);
 }
 
 void