minor but important fix for the wrap-buffer case in a recording audio diskstream
authorPaul Davis <paul@linuxaudiosystems.com>
Sun, 25 Sep 2011 20:08:48 +0000 (20:08 +0000)
committerPaul Davis <paul@linuxaudiosystems.com>
Sun, 25 Sep 2011 20:08:48 +0000 (20:08 +0000)
git-svn-id: svn://localhost/ardour2/branches/3.0@10122 d708f5d6-7413-0410-9779-e7cbd77b26cf

libs/ardour/audio_diskstream.cc

index 9ffadfd16b39f4aaa3c68a2cead0905edf235670..243ccdb9d15bfbc9d62789c5acf0cc94e98de7b5 100644 (file)
@@ -491,8 +491,8 @@ AudioDiskstream::process (framepos_t transport_frame, pframes_t nframes, bool ca
                                assert(ap);
                                assert(rec_nframes <= (framecnt_t) ap->get_audio_buffer(nframes).capacity());
 
-                               Sample *bbuf = ap->get_audio_buffer (nframes).data (rec_offset);
-                               memcpy (chaninfo->current_capture_buffer, bbuf, sizeof (Sample) * rec_nframes);
+                               Sample *buf = ap->get_audio_buffer (nframes).data (rec_offset);
+                               memcpy (chaninfo->current_capture_buffer, buf, sizeof (Sample) * rec_nframes);
 
                        } else {
 
@@ -506,7 +506,7 @@ AudioDiskstream::process (framepos_t transport_frame, pframes_t nframes, bool ca
                                AudioPort* const ap = _io->audio (n);
                                assert(ap);
 
-                               Sample* buf = ap->get_audio_buffer(nframes).data();
+                               Sample* buf = ap->get_audio_buffer(nframes).data (rec_offset);
                                framecnt_t first = chaninfo->capture_vector.len[0];
 
                                memcpy (chaninfo->capture_wrap_buffer, buf, sizeof (Sample) * first);