Do not add whole-file regions to playlists

Various operations, notably time-stretch and other filters, directly
added the generated whole-file region to the playlist.
The editor has not listed the generated Region in the RegionList.
This commit is contained in:
Robin Gareus 2022-10-06 23:52:53 +02:00
parent f6e471f48d
commit 8d045e15dc
1 changed files with 8 additions and 0 deletions

View File

@ -680,6 +680,10 @@ Playlist::clear_pending ()
void
Playlist::add_region (boost::shared_ptr<Region> region, timepos_t const & position, float times, bool auto_partition)
{
if (region->whole_file ()) {
region = RegionFactory::create (region, region->derive_properties ());
}
RegionWriteLock rlock (this);
times = fabs (times);
@ -792,6 +796,10 @@ Playlist::add_region_internal (boost::shared_ptr<Region> region, timepos_t const
void
Playlist::replace_region (boost::shared_ptr<Region> old, boost::shared_ptr<Region> newr, timepos_t const & pos)
{
if (newr->whole_file ()) {
newr = RegionFactory::create (newr, newr->derive_properties ());
}
RegionWriteLock rlock (this);
remove_region_internal (old, rlock.thawlist);