diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2009-06-29 14:29:53 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2009-06-29 14:29:53 +0000 |
commit | 4df4574be472b599e149af2ef161ed505088e71a (patch) | |
tree | 4e20f4761188f915f4604e24e8438e94befe1bd3 /libs/ardour/buffer_set.cc | |
parent | 48fc492253cdbde32979c1dd0dbc1dcb829f802c (diff) |
editor toggle button fix from lincoln; refresh location display when loop range changes; fix up BufferSet::merge_from() to be less fragile to wierd merge conditions
git-svn-id: svn://localhost/ardour2/branches/3.0@5297 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/buffer_set.cc')
-rw-r--r-- | libs/ardour/buffer_set.cc | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/libs/ardour/buffer_set.cc b/libs/ardour/buffer_set.cc index 319444e1b9..7e6ddd68dd 100644 --- a/libs/ardour/buffer_set.cc +++ b/libs/ardour/buffer_set.cc @@ -229,17 +229,19 @@ BufferSet::read_from (BufferSet& in, nframes_t nframes) void BufferSet::merge_from (BufferSet& in, nframes_t nframes) { - assert(available() >= in.count()); + /* merge all input buffers into out existing buffers. + + NOTE: if "in" contains more buffers than this set, + we will drop the extra buffers. + + */ - /* merge all input buffers into out existing buffers */ for (DataType::iterator t = DataType::begin(); t != DataType::end(); ++t) { BufferSet::iterator o = begin(*t); - for (BufferSet::iterator i = in.begin(*t); i != in.end(*t); ++i, ++o) { + for (BufferSet::iterator i = in.begin(*t); i != in.end(*t) && o != end (*t); ++i, ++o) { o->merge_from (*i, nframes); } } - - set_count (in.count()); } void |