comparison transform/FeatureExtractionModelTransformer.cpp @ 557:a40023bebd15

* Fix crash when processing a file that is shorter than a single block
author Chris Cannam
date Tue, 10 Feb 2009 17:24:30 +0000
parents 53e5dc8439e7
children 1d7ebc05157e
comparison
equal deleted inserted replaced
556:53e5dc8439e7 557:a40023bebd15
470 // << blockFrame << ", endFrame " << endFrame << ", blockSize " 470 // << blockFrame << ", endFrame " << endFrame << ", blockSize "
471 // << blockSize << std::endl; 471 // << blockSize << std::endl;
472 472
473 long completion = 473 long completion =
474 (((blockFrame - contextStart) / stepSize) * 99) / 474 (((blockFrame - contextStart) / stepSize) * 99) /
475 (contextDuration / stepSize); 475 (contextDuration / stepSize + 1);
476 476
477 // channelCount is either m_input.getModel()->channelCount or 1 477 // channelCount is either m_input.getModel()->channelCount or 1
478 478
479 if (frequencyDomain) { 479 if (frequencyDomain) {
480 for (size_t ch = 0; ch < channelCount; ++ch) { 480 for (size_t ch = 0; ch < channelCount; ++ch) {