summaryrefslogtreecommitdiff
path: root/libs/ardour/audio_diskstream.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2007-04-26 20:54:31 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2007-04-26 20:54:31 +0000
commit87726495c30f90554b5204b5385d17274a8fe93e (patch)
treed7ecaf0be9b5cbd2afa226cd02cb53a36875d6a2 /libs/ardour/audio_diskstream.cc
parent45d3ec1437cf661533bc7750c623865def4424df (diff)
Merged changes from trunk 1699:1751 into 2.1-staging
git-svn-id: svn://localhost/ardour2/branches/2.1-staging@1752 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/audio_diskstream.cc')
-rw-r--r--libs/ardour/audio_diskstream.cc11
1 files changed, 10 insertions, 1 deletions
diff --git a/libs/ardour/audio_diskstream.cc b/libs/ardour/audio_diskstream.cc
index 48085d4922..b372c14b57 100644
--- a/libs/ardour/audio_diskstream.cc
+++ b/libs/ardour/audio_diskstream.cc
@@ -610,7 +610,16 @@ AudioDiskstream::process (nframes_t transport_frame, nframes_t nframes, nframes_
if (nominally_recording || rec_nframes) {
- for (n = 0, chan = c->begin(); chan != c->end(); ++chan, ++n) {
+ uint32_t limit = _io->n_inputs ();
+
+ /* one or more ports could already have been removed from _io, but our
+ channel setup hasn't yet been updated. prevent us from trying to
+ use channels that correspond to missing ports. note that the
+ process callback (from which this is called) is always atomic
+ with respect to port removal/addition.
+ */
+
+ for (n = 0, chan = c->begin(); chan != c->end() && n < limit; ++chan, ++n) {
ChannelInfo* chaninfo (*chan);