summaryrefslogtreecommitdiff
path: root/libs
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2017-02-22 09:35:49 +0100
committerPaul Davis <paul@linuxaudiosystems.com>2017-02-22 09:35:49 +0100
commite60147d22dc4e12936df14cff59a4fb37711bf6d (patch)
treec7d7a1937e4921c39eb9b3b3859635a6b5cf4ff0 /libs
parent2926555e295ea39904a0127d776a5c5b1531141f (diff)
if a slave's masters are at zero, lock slave to zero and not NaN
Diffstat (limited to 'libs')
-rw-r--r--libs/ardour/slavable_automation_control.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/libs/ardour/slavable_automation_control.cc b/libs/ardour/slavable_automation_control.cc
index c67cb64188..cd46194316 100644
--- a/libs/ardour/slavable_automation_control.cc
+++ b/libs/ardour/slavable_automation_control.cc
@@ -103,7 +103,12 @@ SlavableAutomationControl::actually_set_value (double value, PBD::Controllable::
if (!_masters.empty()) {
/* need to scale given value by current master's scaling */
- value /= get_masters_value_locked();
+ const double masters_value = get_masters_value_locked();
+ if (masters_value == 0.0) {
+ value = 0.0;
+ } else {
+ value /= masters_value;
+ }
}
}