diff transform/RealTimeEffectModelTransformer.cpp @ 497:b6dc6c7f402c

Various fixes: * Fix handling of HTTP redirects (avoiding crashes... I hope) * Fix failure to delete FFT models when a feature extraction model transformer was abandoned (also a cause of crashes in the past) * Fix deadlock when said transform was abandoned before its source model was ready because the session was being cleared (and so the source model would never be ready)
author Chris Cannam
date Fri, 28 Nov 2008 13:36:13 +0000
parents 6036b38177e2
children f84f147572b9 b4a8d8221eaf
line wrap: on
line diff
--- a/transform/RealTimeEffectModelTransformer.cpp	Thu Nov 27 22:09:58 2008 +0000
+++ b/transform/RealTimeEffectModelTransformer.cpp	Fri Nov 28 13:36:13 2008 +0000
@@ -121,10 +121,11 @@
     DenseTimeValueModel *input = getConformingInput();
     if (!input) return;
 
-    while (!input->isReady()) {
+    while (!input->isReady() && !m_abandoned) {
         std::cerr << "RealTimeEffectModelTransformer::run: Waiting for input model to be ready..." << std::endl;
-        sleep(1);
+        usleep(500000);
     }
+    if (m_abandoned) return;
 
     SparseTimeValueModel *stvm = dynamic_cast<SparseTimeValueModel *>(m_output);
     WritableWaveFileModel *wwfm = dynamic_cast<WritableWaveFileModel *>(m_output);