Remove LocaleGuard from ARDOUR::AudioDiskstream state methods
[ardour.git] / libs / ardour / strip_silence.cc
index ff79371b966551bbc54fcd2dc1ce6751316e04f6..1cbb81a3edd7c43a49f2a5a49fc54d785cbb2579 100644 (file)
@@ -116,16 +116,22 @@ StripSilence::run (boost::shared_ptr<Region> r, Progress* progress)
                plist.add (Properties::position, r->position() + (i->first - r->start()));
 
                copy = boost::dynamic_pointer_cast<AudioRegion> (
-                       RegionFactory::create (region, (i->first - r->start()), plist)
+                       RegionFactory::create (region, MusicFrame (i->first - r->start(), 0), plist)
                        );
 
                copy->set_name (RegionFactory::new_region_name (region->name ()));
 
-               framecnt_t const f = std::min (_fade_length, (i->second - i->first));
+               framecnt_t const f = std::min (_fade_length, (i->second - i->first) / 2);
 
-               copy->set_fade_in_active (true);
-               copy->set_fade_in (FadeLinear, f);
-               copy->set_fade_out (FadeLinear, f);
+               if (f > 0) {
+                       copy->set_fade_in_active (true);
+                       copy->set_fade_out_active (true);
+                       copy->set_fade_in (FadeLinear, f);
+                       copy->set_fade_out (FadeLinear, f);
+               } else {
+                       copy->set_fade_in_active (false);
+                       copy->set_fade_out_active (false);
+               }
                results.push_back (copy);
 
                if (progress && (n <= N)) {