X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=libs%2Fardour%2Fstrip_silence.cc;h=8aa703740bdc707705a807134e2c4b9c1f2c9b61;hb=8139becb1898187729b0ea57f145302d4975bf3a;hp=b0109d5989b83b171678b442ef1ef4ed1eb40459;hpb=861d6f81a3f455d6d2cce6b698507404db73d9bf;p=ardour.git diff --git a/libs/ardour/strip_silence.cc b/libs/ardour/strip_silence.cc index b0109d5989..8aa703740b 100644 --- a/libs/ardour/strip_silence.cc +++ b/libs/ardour/strip_silence.cc @@ -32,7 +32,7 @@ using namespace ARDOUR; * @param fade_length Length of fade in/out to apply to trimmed regions, in samples. */ -StripSilence::StripSilence (Session & s, const AudioIntervalMap& sm, framecnt_t fade_length) +StripSilence::StripSilence (Session & s, const AudioIntervalMap& sm, samplecnt_t fade_length) : Filter (s) , _smap (sm) , _fade_length (fade_length) @@ -98,7 +98,7 @@ StripSilence::run (boost::shared_ptr r, Progress* progress) AudioIntervalResult::const_iterator last_silence = silence.end (); --last_silence; - frameoffset_t const end_of_region = r->start() + r->length(); + sampleoffset_t const end_of_region = r->start() + r->length(); if (last_silence->second < end_of_region - 1) { audible.push_back (std::make_pair (last_silence->second, end_of_region - 1)); @@ -116,12 +116,12 @@ StripSilence::run (boost::shared_ptr r, Progress* progress) plist.add (Properties::position, r->position() + (i->first - r->start())); copy = boost::dynamic_pointer_cast ( - RegionFactory::create (region, (i->first - r->start()), plist) + RegionFactory::create (region, MusicSample (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)); + samplecnt_t const f = std::min (_fade_length, (i->second - i->first) / 2); if (f > 0) { copy->set_fade_in_active (true);