Clip defaults of control parameters to range.
authorDavid Schleef <ds@schleef.org>
Fri, 20 Sep 2002 21:38:13 +0000 (21:38 +0000)
committerDavid Schleef <ds@schleef.org>
Fri, 20 Sep 2002 21:38:13 +0000 (21:38 +0000)
Original commit message from CVS:
Clip defaults of control parameters to range.

ext/ladspa/gstladspa.c

index e0d007d..fdb19e1 100644 (file)
@@ -282,6 +282,10 @@ gst_ladspa_class_init (GstLADSPAClass *klass)
         klass->control_info[i].def = 440.0;
     }
 #endif /* LADSPA_IS_HINT_HAS_DEFAULT */
+    if(klass->control_info[i].def < klass->control_info[i].lowerbound)
+      klass->control_info[i].def = klass->control_info[i].lowerbound;
+    if(klass->control_info[i].def > klass->control_info[i].upperbound)
+      klass->control_info[i].def = klass->control_info[i].upperbound;
     
     if (LADSPA_IS_PORT_INPUT(desc->PortDescriptors[current_portnum])) {
       argperms = G_PARAM_READWRITE;