expand the test used to decide if we need to make copies when uncombining a compound...
authorPaul Davis <paul@linuxaudiosystems.com>
Thu, 9 Jan 2020 05:19:36 +0000 (22:19 -0700)
committerPaul Davis <paul@linuxaudiosystems.com>
Thu, 9 Jan 2020 05:21:21 +0000 (22:21 -0700)
libs/ardour/playlist.cc

index adcd1d059b8c050ab6b1628cecdfb45e54f2eaf4..0474fc009605cb51771e08b5762b06c079ddbd8f 100644 (file)
@@ -3248,7 +3248,9 @@ Playlist::uncombine (boost::shared_ptr<Region> target)
           the original regions that we find, and add them
           instead.
        */
-       bool same_playlist = (pls->original() == id());
+
+       const bool need_copies = (boost::dynamic_pointer_cast<PlaylistSource> (pls)->owner() != target->id()) ||
+               (pls->original() != id());
 
        for (RegionList::const_iterator i = rl.begin(); i != rl.end(); ++i) {
 
@@ -3270,7 +3272,7 @@ Playlist::uncombine (boost::shared_ptr<Region> target)
                        adjusted_end = adjusted_start + target->length();
                }
 
-               if (!same_playlist) {
+               if (need_copies) {
                        samplepos_t pos = original->position();
                        /* make a copy, but don't announce it */
                        original = RegionFactory::create (original, false);