summaryrefslogtreecommitdiff
path: root/sms/sms.c
diff options
context:
space:
mode:
Diffstat (limited to 'sms/sms.c')
-rw-r--r--sms/sms.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/sms/sms.c b/sms/sms.c
index 78ccb6b..3a02b4b 100644
--- a/sms/sms.c
+++ b/sms/sms.c
@@ -344,14 +344,21 @@ int sms_initAnalysis(SMS_AnalParams *pAnalParams)
sms_error("Could not allocate memory for guides");
return -1;
}
+
/* initial guide values */
- if(pAnalParams->iFormat == SMS_FORMAT_H ||
- pAnalParams->iFormat == SMS_FORMAT_HP)
+ for (i = 0; i < pAnalParams->nGuides; i++)
{
- for (i = 0; i < pAnalParams->nGuides; i++)
+ if(pAnalParams->iFormat == SMS_FORMAT_H || pAnalParams->iFormat == SMS_FORMAT_HP)
{
pAnalParams->guides[i].fFreq = pAnalParams->fDefaultFundamental * (i + 1);
}
+ else
+ {
+ pAnalParams->guides[i].fFreq = 0.0;
+ }
+ pAnalParams->guides[i].fMag = 0.0;
+ pAnalParams->guides[i].iPeakChosen = -1;
+ pAnalParams->guides[i].iStatus = 0;
}
/* stochastic analysis */
@@ -671,7 +678,7 @@ int sms_initFrame(int iCurrentFrame, SMS_AnalParams *pAnalParams, int sizeWindow
pAnalParams->ppFrames[iCurrentFrame-1]->iFrameSample + pAnalParams->sizeHop;
/* check for end of sound */
- if ((pAnalParams->ppFrames[iCurrentFrame]->iFrameSample + (sizeWindow+1)/2) >= pAnalParams->iSizeSound
+ if((pAnalParams->ppFrames[iCurrentFrame]->iFrameSample + (sizeWindow+1)/2) >= pAnalParams->iSizeSound
&& pAnalParams->iSizeSound > 0)
{
pAnalParams->ppFrames[iCurrentFrame]->iFrameNum = -1;