comparison 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
comparison
equal deleted inserted replaced
496:05383ee78f3e 497:b6dc6c7f402c
119 RealTimeEffectModelTransformer::run() 119 RealTimeEffectModelTransformer::run()
120 { 120 {
121 DenseTimeValueModel *input = getConformingInput(); 121 DenseTimeValueModel *input = getConformingInput();
122 if (!input) return; 122 if (!input) return;
123 123
124 while (!input->isReady()) { 124 while (!input->isReady() && !m_abandoned) {
125 std::cerr << "RealTimeEffectModelTransformer::run: Waiting for input model to be ready..." << std::endl; 125 std::cerr << "RealTimeEffectModelTransformer::run: Waiting for input model to be ready..." << std::endl;
126 sleep(1); 126 usleep(500000);
127 } 127 }
128 if (m_abandoned) return;
128 129
129 SparseTimeValueModel *stvm = dynamic_cast<SparseTimeValueModel *>(m_output); 130 SparseTimeValueModel *stvm = dynamic_cast<SparseTimeValueModel *>(m_output);
130 WritableWaveFileModel *wwfm = dynamic_cast<WritableWaveFileModel *>(m_output); 131 WritableWaveFileModel *wwfm = dynamic_cast<WritableWaveFileModel *>(m_output);
131 if (!stvm && !wwfm) return; 132 if (!stvm && !wwfm) return;
132 133