summaryrefslogtreecommitdiff
path: root/libs/ardour
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2012-05-23 20:32:12 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2012-05-23 20:32:12 +0000
commit2a262b55cbaa1e27f1e55b80ad2893fd408e0e2a (patch)
tree0a915e3e45672b0a8aedac9246e959df1804abfa /libs/ardour
parent27e64c14394e309d6b2d2d911bbc4165d6f18263 (diff)
stop deadlock when pasting into a playlist
git-svn-id: svn://localhost/ardour2/branches/3.0@12400 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour')
-rw-r--r--libs/ardour/playlist.cc26
1 files changed, 14 insertions, 12 deletions
diff --git a/libs/ardour/playlist.cc b/libs/ardour/playlist.cc
index 0e1aad110d..12490d02d7 100644
--- a/libs/ardour/playlist.cc
+++ b/libs/ardour/playlist.cc
@@ -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;
}
}