aboutsummaryrefslogtreecommitdiff
path: root/libs/gst/controller/gstdirectcontrolbinding.c
diff options
context:
space:
mode:
Diffstat (limited to 'libs/gst/controller/gstdirectcontrolbinding.c')
-rw-r--r--libs/gst/controller/gstdirectcontrolbinding.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libs/gst/controller/gstdirectcontrolbinding.c b/libs/gst/controller/gstdirectcontrolbinding.c
index b7d06bc..ca173b0 100644
--- a/libs/gst/controller/gstdirectcontrolbinding.c
+++ b/libs/gst/controller/gstdirectcontrolbinding.c
@@ -85,7 +85,7 @@ convert_g_value_to_##type (GstDirectControlBinding *self, gdouble s, GValue *d)
g##type v; \
\
s = CLAMP (s, 0.0, 1.0); \
- v = pspec->minimum + (g##type) ROUNDING_OP ((pspec->maximum - pspec->minimum) * s); \
+ v = (g##type) ROUNDING_OP (pspec->minimum * (1-s)) + (g##type) ROUNDING_OP (pspec->maximum * s); \
g_value_set_##type (d, v); \
} \
\
@@ -96,7 +96,7 @@ convert_value_to_##type (GstDirectControlBinding *self, gdouble s, gpointer d_)
g##type *d = (g##type *)d_; \
\
s = CLAMP (s, 0.0, 1.0); \
- *d = pspec->minimum + (g##type) ROUNDING_OP ((pspec->maximum - pspec->minimum) * s); \
+ *d = (g##type) ROUNDING_OP (pspec->minimum * (1-s)) + (g##type) ROUNDING_OP (pspec->maximum * s); \
}