diff options
author | Carl Hetherington <carl@carlh.net> | 2011-12-27 19:10:31 +0000 |
---|---|---|
committer | Carl Hetherington <carl@carlh.net> | 2011-12-27 19:10:31 +0000 |
commit | 86cb9348e829e61b7c1e324930882af147f504c9 (patch) | |
tree | 2b3c64afa6801cc932a121eb1b457c277ee9bc60 /libs/ardour/playlist.cc | |
parent | 78c4324026406e3c4e13c45e49a7dda45f964e89 (diff) |
Hack around one case where satisfying all constraints in a
relayer is impossible.
git-svn-id: svn://localhost/ardour2/branches/3.0@11096 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/playlist.cc')
-rw-r--r-- | libs/ardour/playlist.cc | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/libs/ardour/playlist.cc b/libs/ardour/playlist.cc index c149ff30cf..1eebafba5a 100644 --- a/libs/ardour/playlist.cc +++ b/libs/ardour/playlist.cc @@ -2410,6 +2410,11 @@ Playlist::compute_temporary_layers (RegionList const & relayer_regions) continue; } + DEBUG_TRACE (DEBUG::Layering, "Overlaps to check:\n"); + for (RegionList::iterator j = overlaps_to_check.begin(); j != overlaps_to_check.end(); ++j) { + DEBUG_TRACE (DEBUG::Layering, string_compose ("\t%1\n", (*j)->name())); + } + /* Put *i on our overlaps_to_check_list */ overlaps_to_check.push_back (*i); @@ -2446,6 +2451,14 @@ Playlist::compute_temporary_layers (RegionList const & relayer_regions) next_layer = temporary_layers.get (*j); } + if (next_layer < previous_layer) { + /* If this happens, it means that it's impossible to put *i between overlaps_to_check + in a way that satisfies the current layering rule. So we'll punt and put *i + above previous_layer. + */ + next_layer = DBL_MAX; + } + /* Now we know where *i and overlaps_to_preserve should go: between previous_layer and next_layer. */ |