fix replicate_missing_region_channels option
authorRobin Gareus <robin@gareus.org>
Sat, 28 Dec 2013 20:12:57 +0000 (21:12 +0100)
committerRobin Gareus <robin@gareus.org>
Sat, 28 Dec 2013 20:12:57 +0000 (21:12 +0100)
libs/ardour/audioregion.cc

index d101583aa4b1086d6028243e0a0c8c714b77cc19..e9b0b1fc076d9b876935742f8ea5cd0101d00d0c 100644 (file)
@@ -736,7 +736,7 @@ AudioRegion::read_from_sources (SourceList const & srcs, framecnt_t limit, Sampl
 
                        /* copy an existing channel's data in for this non-existant one */
 
-                       uint32_t channel = n_channels() % chan_n;
+                       uint32_t channel = chan_n % n_channels();
                        boost::shared_ptr<AudioSource> src = boost::dynamic_pointer_cast<AudioSource> (srcs[channel]);
 
                        if (src->read (buf, _start + internal_offset, to_read) != to_read) {