Silence detect: constrain duration in GUI.
[ardour.git] / gtk2_ardour / strip_silence_dialog.cc
index 7118d1c5507120dda27b8985b1f28f7f0d61a7f3..7d07a0ba3b382aad8a6ecf79bcafe8b852912e50 100644 (file)
@@ -275,13 +275,13 @@ StripSilenceDialog::threshold_changed ()
 framecnt_t
 StripSilenceDialog::minimum_length () const
 {
-       return _minimum_length->current_duration (views.front().view->region()->position());
+       return std::max((framecnt_t)1, _minimum_length->current_duration (views.front().view->region()->position()));
 }
 
 framecnt_t
 StripSilenceDialog::fade_length () const
 {
-       return _fade_length->current_duration (views.front().view->region()->position());
+       return std::max((framecnt_t)0, _fade_length->current_duration (views.front().view->region()->position()));
 }
 
 void