gstlv2utils.c: avoid implicit float to int conversion
authorJordan Petridis <jordan@centricular.com>
Mon, 3 Aug 2020 15:40:31 +0000 (18:40 +0300)
committerGStreamer Merge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Tue, 4 Aug 2020 11:37:52 +0000 (11:37 +0000)
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1487>

ext/lv2/gstlv2utils.c

index 42d2ab1..0080d53 100644 (file)
@@ -543,9 +543,11 @@ gst_lv2_object_get_property (GstLV2 * lv2, GObject * object,
     case G_TYPE_BOOLEAN:
       g_value_set_boolean (value, controls[prop_id] > 0.0f);
       break;
-    case G_TYPE_INT:
-      g_value_set_int (value, CLAMP (controls[prop_id], G_MININT, G_MAXINT));
+    case G_TYPE_INT:{
+      gint64 ival = CLAMP ((gint64) controls[prop_id], G_MININT, G_MAXINT);
+      g_value_set_int (value, ival);
       break;
+    }
     case G_TYPE_FLOAT:
       g_value_set_float (value, controls[prop_id]);
       break;