stop deadlock when pasting into a playlist

git-svn-id: svn://localhost/ardour2/branches/3.0@12400 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Paul Davis 2012-05-23 20:32:12 +00:00
parent 27e64c1439
commit 2a262b55cb

View File

@ -1196,7 +1196,6 @@ Playlist::flush_notifications (bool from_undo)
times = fabs (times);
{
RegionWriteLock rl1 (this);
RegionReadLock rl2 (other.get());
int itimes = (int) floor (times);
@ -1204,18 +1203,21 @@ Playlist::flush_notifications (bool from_undo)
framecnt_t const shift = other->_get_extent().second;
layer_t top = top_layer ();
while (itimes--) {
for (RegionList::iterator i = other->regions.begin(); i != other->regions.end(); ++i) {
boost::shared_ptr<Region> copy_of_region = RegionFactory::create (*i, true);
/* put these new regions on top of all existing ones, but preserve
the ordering they had in the original playlist.
*/
add_region_internal (copy_of_region, (*i)->position() + pos);
set_layer (copy_of_region, copy_of_region->layer() + top);
{
RegionWriteLock rl1 (this);
while (itimes--) {
for (RegionList::iterator i = other->regions.begin(); i != other->regions.end(); ++i) {
boost::shared_ptr<Region> copy_of_region = RegionFactory::create (*i, true);
/* put these new regions on top of all existing ones, but preserve
the ordering they had in the original playlist.
*/
add_region_internal (copy_of_region, (*i)->position() + pos);
set_layer (copy_of_region, copy_of_region->layer() + top);
}
pos += shift;
}
pos += shift;
}
}