diff transform/FeatureExtractionModelTransformer.cpp @ 678:948271d124ac

Make more (though still not entirely) robust in the face of running out of disc space
author Chris Cannam
date Thu, 14 Apr 2011 15:20:27 +0100
parents 3bbac921b70a
children c8badbd4c005
line wrap: on
line diff
--- a/transform/FeatureExtractionModelTransformer.cpp	Thu Apr 07 15:20:35 2011 +0100
+++ b/transform/FeatureExtractionModelTransformer.cpp	Thu Apr 14 15:20:27 2011 +0100
@@ -487,6 +487,8 @@
         imaginaries = new float[blockSize/2 + 1];
     }
 
+    QString error = "";
+
     while (!m_abandoned) {
 
         if (frequencyDomain) {
@@ -515,6 +517,12 @@
                     buffers[ch][i*2] = reals[i];
                     buffers[ch][i*2+1] = imaginaries[i];
                 }
+                error = fftModels[ch]->getError();
+                if (error != "") {
+                    std::cerr << "FeatureExtractionModelTransformer::run: Abandoning, error is " << error << std::endl;
+                    m_abandoned = true;
+                    m_message = error;
+                }
             }
         } else {
             getFrames(channelCount, blockFrame, blockSize, buffers);