changeset 1499:68a0abfe7263

Merge
author Chris Cannam
date Mon, 13 Aug 2018 15:37:41 +0100
parents 850bc66d6a70 (current diff) fde8c497373f (diff)
children 9d37c8cf9686 0ee87bc10cdc 2057423c88fe
files
diffstat 1 files changed, 22 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/transform/RealTimeEffectModelTransformer.cpp	Mon Aug 13 15:37:31 2018 +0100
+++ b/transform/RealTimeEffectModelTransformer.cpp	Mon Aug 13 15:37:41 2018 +0100
@@ -47,14 +47,14 @@
 
     QString pluginId = transform.getPluginIdentifier();
 
-//    SVDEBUG << "RealTimeEffectModelTransformer::RealTimeEffectModelTransformer: plugin " << pluginId << ", output " << output << endl;
+    SVDEBUG << "RealTimeEffectModelTransformer::RealTimeEffectModelTransformer: plugin " << pluginId << ", output " << transform.getOutput() << endl;
 
     RealTimePluginFactory *factory =
         RealTimePluginFactory::instanceFor(pluginId);
 
     if (!factory) {
-        cerr << "RealTimeEffectModelTransformer: No factory available for plugin id \""
-                  << pluginId << "\"" << endl;
+        SVCERR << "RealTimeEffectModelTransformer: No factory available for plugin id \""
+               << pluginId << "\"" << endl;
         return;
     }
 
@@ -67,8 +67,8 @@
                                           input->getChannelCount());
 
     if (!m_plugin) {
-        cerr << "RealTimeEffectModelTransformer: Failed to instantiate plugin \""
-             << pluginId << "\"" << endl;
+        SVCERR << "RealTimeEffectModelTransformer: Failed to instantiate plugin \""
+               << pluginId << "\"" << endl;
         return;
     }
 
@@ -129,13 +129,25 @@
         SVDEBUG << "RealTimeEffectModelTransformer::run: Waiting for input model to be ready..." << endl;
         usleep(500000);
     }
-    if (m_abandoned) return;
+    if (m_abandoned) {
+        return;
+    }
+    if (m_outputs.empty()) {
+        return;
+    }
+    
+    SparseTimeValueModel *stvm =
+        dynamic_cast<SparseTimeValueModel *>(m_outputs[0]);
+    WritableWaveFileModel *wwfm =
+        dynamic_cast<WritableWaveFileModel *>(m_outputs[0]);
 
-    SparseTimeValueModel *stvm = dynamic_cast<SparseTimeValueModel *>(m_outputs[0]);
-    WritableWaveFileModel *wwfm = dynamic_cast<WritableWaveFileModel *>(m_outputs[0]);
-    if (!stvm && !wwfm) return;
+    if (!stvm && !wwfm) {
+        return;
+    }
 
-    if (stvm && (m_outputNo >= int(m_plugin->getControlOutputCount()))) return;
+    if (stvm && (m_outputNo >= int(m_plugin->getControlOutputCount()))) {
+        return;
+    }
 
     sv_samplerate_t sampleRate = input->getSampleRate();
     int channelCount = input->getChannelCount();