MCPcopy Create free account
hub / github.com/audeering/opensmile / myFinaliseInstance

Method myFinaliseInstance

src/core/dataReader.cpp:191–329  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

189}
190
191int cDataReader::myFinaliseInstance()
192{
193 int i,j;
194 double lT = -1.0;
195 long lN = 0;
196 long lNf = 0;
197
198 for (i = 0; i < nLevels; i++) {
199 // find multiple levels, register multiple readers...
200 if (!dm->namesAreSet(level[i])) {
201 SMILE_IDBG(3,"finaliseInstance: names in input level '%s' are not yet set... waiting.",
202 dmLevel[i]);
203 return 0;
204 }
205 }
206
207 if (Lf == NULL)
208 Lf = (int*)calloc(1,sizeof(int)*(nLevels+1));
209 if (Le == NULL)
210 Le = (int*)calloc(1,sizeof(int)*(nLevels+1));
211 int * bufSizes = (int *)calloc(1, sizeof(int) * (nLevels + 1));
212 int isRb = -1;
213 int growDyn = -1;
214 int bufSizeMax = 0;
215
216 for (i = 0; i < nLevels; i++) {
217 if (rdId[i] == -1) {
218 rdId[i] = dm->registerReader(level[i]);
219 SMILE_IDBG(2, "registered reader level[i=%i]=%i ('%s'), rdId=%i",
220 i, level[i], dm->getLevelName(level[i]), rdId[i]);
221 }
222
223 const sDmLevelConfig *c = dm->getLevelConfig(level[i]);
224 if (c != NULL) {
225 // check bufsizes, growdyn and rb for consistency.
226 // if these are not consistent this might cause hidden problems, i.e. blocking the processing chain
227 bufSizes[i] = c->nT;
228 if (c->nT > bufSizeMax)
229 bufSizeMax = c->nT;
230 if (isRb == -1)
231 isRb = c->isRb;
232 if (growDyn == -1)
233 growDyn = c->growDyn;
234 if (growDyn != c->growDyn) {
235 SMILE_IWRN(2, "Inconsistency in input level parameters. growDyn on first (#1) input = %i, growDyn on input # %i (%s) = %i. This might cause the processing to hang unpredictably or cause incomplete processing.",
236 growDyn, i + 1, c->name, c->growDyn);
237 }
238 if (isRb != c->isRb) {
239 SMILE_IWRN(2, "Inconsistency in input level parameters. isRb on first (#1) input = %i, isRb on input # %i (%s) = %i. This might cause the processing to hang unpredictably or cause incomplete processing.",
240 isRb, i + 1, c->name, c->isRb);
241 }
242
243 // check if all levels have the same period!!
244 // (do not proceed unless forceAsyncMerge option is given in config!)
245 if (lT == -1.0)
246 lT = c->T;
247 else if ((c->T != lT) && (fabs(c->T - lT) > 10e-10) && (!forceAsyncMerge)) {
248 SMILE_IERR(1, "frame period mismatch among input levels! '%s':%e <> '%s':%e",

Callers

nothing calls this directly

Calls 5

namesAreSetMethod · 0.45
registerReaderMethod · 0.45
getLevelNameMethod · 0.45
getLevelConfigMethod · 0.45
copyFromMethod · 0.45

Tested by

no test coverage detected