diff vamp-server/simple-server.cpp @ 188:90c962b68d7f

Merge pull request #2 from piper-audio/dev/step-and-block-size Pull step & block size out into framing struct, return in config
author Chris Cannam <cannam@all-day-breakfast.com>
date Mon, 06 Feb 2017 12:04:25 +0000
parents 3eb00e5c76c4
children 52322dde68ea
line wrap: on
line diff
--- a/vamp-server/simple-server.cpp	Fri Feb 03 13:00:42 2017 +0000
+++ b/vamp-server/simple-server.cpp	Mon Feb 06 12:04:25 2017 +0000
@@ -484,11 +484,18 @@
             throw runtime_error("plugin has already been configured");
         }
 
+        if (creq.configuration.framing.stepSize == 0 ||
+            creq.configuration.framing.blockSize == 0) {
+            throw runtime_error("step and block size must be non-zero");
+        }
+
         response.configurationResponse = LoaderRequests().configurePlugin(creq);
         
         if (!response.configurationResponse.outputs.empty()) {
             mapper.markConfigured
-                (h, creq.configuration.channelCount, creq.configuration.blockSize);
+                (h,
+                 creq.configuration.channelCount,
+                 creq.configuration.framing.blockSize);
             response.success = true;
         }
         break;