From c6e71a683e6a685ed55c35670c6b4bfd20e38b5f Mon Sep 17 00:00:00 2001 From: Guido Aulisi Date: Sat, 16 Aug 2014 12:26:33 +0200 Subject: [PATCH] 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. --- libs/evoral/src/Curve.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/libs/evoral/src/Curve.cpp b/libs/evoral/src/Curve.cpp index 20cc5d9ec3..f99a8075d5 100644 --- a/libs/evoral/src/Curve.cpp +++ b/libs/evoral/src/Curve.cpp @@ -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;