Silence detect: constrain duration in GUI.
authorRobin Gareus <robin@gareus.org>
Sat, 19 Sep 2015 21:33:35 +0000 (23:33 +0200)
committerRobin Gareus <robin@gareus.org>
Sat, 19 Sep 2015 21:33:35 +0000 (23:33 +0200)
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