Curve::_get_vector: fix return value when veclen == 1

When the crossfade length is only 1 frame, I got strange
gain coefficients from get_vector (63 in my case).
The function wrongly returned the x axis value.
This commit is contained in:
Guido Aulisi
2014-08-16 12:26:33 +02:00
committed by Robin Gareus
parent 5190cbc9b2
commit c6e71a683e

View File

@@ -302,14 +302,11 @@ Curve::_get_vector (double x0, double x1, float *vec, int32_t veclen)
if (veclen > 1) {
dx_num = hx - lx;
dx_den = veclen - 1;
}
if (veclen > 1) {
for (int i = 0; i < veclen; ++i) {
vec[i] = (lx * (m_num / m_den) + m_num * i * dx_num / (m_den * dx_den)) + c;
}
} else {
vec[0] = lx;
vec[0] = lx * (m_num / m_den) + c;
}
return;