Modify Strip Silence so that it can't create regions with -ve lengths
authorJohn Emmas <johne53@tiscali.co.uk>
Fri, 18 Sep 2015 09:44:07 +0000 (10:44 +0100)
committerJohn Emmas <johne53@tiscali.co.uk>
Fri, 18 Sep 2015 09:44:07 +0000 (10:44 +0100)
AFAICT this could happen if a region's end time (on the timeline) was earlier than the end time in the actual recording. This could cause a situation where the last block of detected silence would have an end time greater than the end tome for the region being processed. Strip Silence would create its new regions - but the last one it created would usually come out with a negative duration.

libs/ardour/strip_silence.cc

index 3839b984bdf00b30bfe4b56c4f5b8db0979c0192..2151a3c232ea6257bbd13a606d422121019c360c 100644 (file)
@@ -100,7 +100,7 @@ StripSilence::run (boost::shared_ptr<Region> r, Progress* progress)
 
        frameoffset_t const end_of_region = r->start() + r->length();
 
-       if (last_silence->second != end_of_region - 1) {
+       if (last_silence->second < end_of_region - 1) {
                audible.push_back (std::make_pair (last_silence->second, end_of_region - 1));
        }