Mercurial > hg > piper-cpp
comparison vamp-server/simple-server.cpp @ 192:458766b73e71
Merge pull request #3 from piper-audio/dev/step-and-block-size
Fix erroneous logic for handling step and block size in prior commit
| author | Chris Cannam <cannam@all-day-breakfast.com> | 
|---|---|
| date | Tue, 07 Feb 2017 09:51:29 +0000 | 
| parents | 52322dde68ea | 
| children | e0e3d9efa774 | 
   comparison
  equal
  deleted
  inserted
  replaced
| 188:90c962b68d7f | 192:458766b73e71 | 
|---|---|
| 493 | 493 | 
| 494 if (!response.configurationResponse.outputs.empty()) { | 494 if (!response.configurationResponse.outputs.empty()) { | 
| 495 mapper.markConfigured | 495 mapper.markConfigured | 
| 496 (h, | 496 (h, | 
| 497 creq.configuration.channelCount, | 497 creq.configuration.channelCount, | 
| 498 creq.configuration.framing.blockSize); | 498 response.configurationResponse.framing.blockSize); | 
| 499 response.success = true; | 499 response.success = true; | 
| 500 } | 500 } | 
| 501 break; | 501 break; | 
| 502 } | 502 } | 
| 503 | 503 | 
| 519 } | 519 } | 
| 520 | 520 | 
| 521 const float **fbuffers = new const float *[channels]; | 521 const float **fbuffers = new const float *[channels]; | 
| 522 for (int i = 0; i < channels; ++i) { | 522 for (int i = 0; i < channels; ++i) { | 
| 523 if (int(preq.inputBuffers[i].size()) != mapper.getBlockSize(h)) { | 523 if (int(preq.inputBuffers[i].size()) != mapper.getBlockSize(h)) { | 
| 524 ostringstream os; | |
| 525 os << "wrong block size supplied to process (" | |
| 526 << preq.inputBuffers[i].size() | |
| 527 << ", expecting " << mapper.getBlockSize(h) << ")" << ends; | |
| 524 delete[] fbuffers; | 528 delete[] fbuffers; | 
| 525 throw runtime_error("wrong block size supplied to process"); | 529 throw runtime_error(os.str()); | 
| 526 } | 530 } | 
| 527 fbuffers[i] = preq.inputBuffers[i].data(); | 531 fbuffers[i] = preq.inputBuffers[i].data(); | 
| 528 } | 532 } | 
| 529 | 533 | 
| 530 response.processResponse.plugin = preq.plugin; | 534 response.processResponse.plugin = preq.plugin; | 
