lv2: reduce log spam for property bounds
authorStefan Sauer <ensonic@users.sf.net>
Mon, 16 May 2016 02:45:26 +0000 (19:45 -0700)
committerStefan Sauer <ensonic@users.sf.net>
Mon, 16 May 2016 02:45:26 +0000 (19:45 -0700)
Only complain about bad bounds, if the plugin actually set those. Otherwise
silently adjust our defaults.

ext/lv2/gstlv2utils.c

index 407f6e3..0224a84 100644 (file)
@@ -364,14 +364,18 @@ gst_lv2_class_get_param_spec (GstLV2Class * klass, GObjectClass * object_class,
   lilv_node_free (lv2max);
 
   if (def < lower) {
-    GST_WARNING ("%s has lower bound %f > default %f",
-        lilv_node_as_string (lilv_plugin_get_uri (lv2plugin)), lower, def);
+    if (lv2def && lv2min) {
+      GST_WARNING ("%s has lower bound %f > default %f",
+          lilv_node_as_string (lilv_plugin_get_uri (lv2plugin)), lower, def);
+    }
     lower = def;
   }
 
   if (def > upper) {
-    GST_WARNING ("%s has upper bound %f < default %f",
-        lilv_node_as_string (lilv_plugin_get_uri (lv2plugin)), upper, def);
+    if (lv2def && lv2max) {
+      GST_WARNING ("%s has upper bound %f < default %f",
+          lilv_node_as_string (lilv_plugin_get_uri (lv2plugin)), upper, def);
+    }
     upper = def;
   }