ladspa: only multiply bounded rate properties by sample rate
authorTim-Philipp Müller <tim@centricular.com>
Wed, 5 Feb 2020 16:12:28 +0000 (16:12 +0000)
committerTim-Philipp Müller <tim@centricular.com>
Thu, 6 Feb 2020 10:15:12 +0000 (10:15 +0000)
We don't want to accidentally multiply G_MAXFLOAT or -GMAXFLOAT
with the sample rate.

ext/ladspa/gstladspautils.c

index f1de000..53ddbb1 100644 (file)
@@ -380,8 +380,10 @@ gst_ladspa_object_class_get_param_spec (GstLADSPAClass * ladspa_class,
 
   if (LADSPA_IS_HINT_SAMPLE_RATE (hintdesc)) {
     /* FIXME:! (*= ladspa->rate?, *= GST_AUDIO_DEF_RATE?) */
-    lower *= 44100;
-    upper *= 44100;
+    if (LADSPA_IS_HINT_BOUNDED_BELOW (hintdesc))
+      lower *= 44100;
+    if (LADSPA_IS_HINT_BOUNDED_ABOVE (hintdesc))
+      upper *= 44100;
   }
 
   if (LADSPA_IS_HINT_INTEGER (hintdesc)) {