13
0

Fix and simplify Playlist::fade_range for multiple ranges

This commit is contained in:
Robin Gareus 2024-09-28 21:14:52 +02:00
parent 6b5582deef
commit 46f61d7662
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04

View File

@ -3413,17 +3413,14 @@ Playlist::fade_range (list<TimelineRange>& ranges)
{
ThawList thawlist;
RegionReadLock rlock (this);
for (list<TimelineRange>::iterator r = ranges.begin(); r != ranges.end(); ) {
list<TimelineRange>::iterator tmpr = r;
++tmpr;
for (RegionList::const_iterator i = regions.begin (); i != regions.end ();) {
RegionList::const_iterator tmpi = i;
++tmpi;
thawlist.add (*i);
(*i)->fade_range ((*r).start().samples(), (*r).end().samples());
i = tmpi;
/* add regions only once, not for each range */
for (auto const& r : regions) {
thawlist.add (r);
}
for (auto const& t: ranges) {
for (auto const& r : regions) {
r->fade_range (t.start().samples(), t.end().samples());
}
r = tmpr;
}
rlock.release ();
thawlist.release ();