Mercurial > hg > vamp-plugin-sdk
comparison vamp-sdk/PluginHostAdapter.cpp @ 7:c66551966b5f
* Fix a couple of memory management and corruption bugs
* Some textual fixes
author | cannam |
---|---|
date | Fri, 31 Mar 2006 17:39:49 +0000 |
parents | 8f10d35a4090 |
children | 44113b1e296b |
comparison
equal
deleted
inserted
replaced
6:8f10d35a4090 | 7:c66551966b5f |
---|---|
221 d.description = sd->description; | 221 d.description = sd->description; |
222 d.unit = sd->unit; | 222 d.unit = sd->unit; |
223 d.hasFixedValueCount = sd->hasFixedValueCount; | 223 d.hasFixedValueCount = sd->hasFixedValueCount; |
224 d.valueCount = sd->valueCount; | 224 d.valueCount = sd->valueCount; |
225 for (unsigned int j = 0; j < sd->valueCount; ++j) { | 225 for (unsigned int j = 0; j < sd->valueCount; ++j) { |
226 d.valueNames.push_back(sd->valueNames[i] ? sd->valueNames[i] : ""); | 226 d.valueNames.push_back(sd->valueNames[j] ? sd->valueNames[j] : ""); |
227 } | 227 } |
228 d.hasKnownExtents = sd->hasKnownExtents; | 228 d.hasKnownExtents = sd->hasKnownExtents; |
229 d.minValue = sd->minValue; | 229 d.minValue = sd->minValue; |
230 d.maxValue = sd->maxValue; | 230 d.maxValue = sd->maxValue; |
231 d.isQuantized = sd->isQuantized; | 231 d.isQuantized = sd->isQuantized; |
284 | 284 |
285 void | 285 void |
286 PluginHostAdapter::convertFeatures(VampFeatureList **features, | 286 PluginHostAdapter::convertFeatures(VampFeatureList **features, |
287 FeatureSet &fs) | 287 FeatureSet &fs) |
288 { | 288 { |
289 if (!features) return; | |
290 | |
289 for (unsigned int i = 0; features[i]; ++i) { | 291 for (unsigned int i = 0; features[i]; ++i) { |
290 | 292 |
291 VampFeatureList &list = *features[i]; | 293 VampFeatureList &list = *features[i]; |
292 | 294 |
293 if (list.featureCount > 0) { | 295 if (list.featureCount > 0) { |
300 list.features[j].nsec); | 302 list.features[j].nsec); |
301 | 303 |
302 for (unsigned int k = 0; k < list.features[j].valueCount; ++k) { | 304 for (unsigned int k = 0; k < list.features[j].valueCount; ++k) { |
303 feature.values.push_back(list.features[j].values[k]); | 305 feature.values.push_back(list.features[j].values[k]); |
304 } | 306 } |
305 | 307 |
306 feature.label = list.features[j].label; | 308 if (list.features[j].label) { |
309 feature.label = list.features[j].label; | |
310 } | |
307 | 311 |
308 fs[i].push_back(feature); | 312 fs[i].push_back(feature); |
309 } | 313 } |
310 } | 314 } |
311 } | 315 } |