projects
/
ardour.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5190cbc
)
Curve::_get_vector: fix return value when veclen == 1
author
Guido Aulisi
<guido.aulisi@gmail.com>
Sat, 16 Aug 2014 10:26:33 +0000
(12:26 +0200)
committer
Robin Gareus
<robin@gareus.org>
Mon, 19 Jan 2015 22:55:52 +0000
(23:55 +0100)
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
patch
|
blob
|
history
diff --git
a/libs/evoral/src/Curve.cpp
b/libs/evoral/src/Curve.cpp
index 20cc5d9ec3a088b9f5ca311621d08f9c1e97e9b0..f99a8075d5d4f5572e9aa232d092916910e9ab66 100644
(file)
--- 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;