diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2009-07-29 19:02:02 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2009-07-29 19:02:02 +0000 |
commit | d775781c2f9453d670612d96640240945b2b6881 (patch) | |
tree | 07a6d313c4f4b9ce57ab27754a3fe122ea66d721 /libs | |
parent | 3ae28868ff02abf44102fff9954e7e8d6359867f (diff) |
avoid crashes caused by the process buffer set being larger than expected when passed into Route::process_output_buffers()
git-svn-id: svn://localhost/ardour2/branches/3.0@5437 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs')
-rw-r--r-- | libs/ardour/audio_track.cc | 9 | ||||
-rw-r--r-- | libs/ardour/internal_send.cc | 2 | ||||
-rw-r--r-- | libs/ardour/route.cc | 1 |
3 files changed, 9 insertions, 3 deletions
diff --git a/libs/ardour/audio_track.cc b/libs/ardour/audio_track.cc index 3c8fe8c42c..8e68eb0140 100644 --- a/libs/ardour/audio_track.cc +++ b/libs/ardour/audio_track.cc @@ -583,7 +583,7 @@ AudioTrack::roll (nframes_t nframes, sframes_t start_frame, sframes_t end_frame, limit = blimit; } else { - for (i = 0, n = 1; i < blimit; ++i, ++n) { + for (i = 0, n = 1; i < limit; ++i, ++n) { memcpy (bufs.get_audio (i).data(), b, sizeof (Sample) * nframes); if (n < diskstream->n_channels().n_audio()) { tmpb = diskstream->playback_buffer(n); @@ -592,6 +592,13 @@ AudioTrack::roll (nframes_t nframes, sframes_t start_frame, sframes_t end_frame, } } } + + /* try to leave any MIDI buffers alone */ + + ChanCount chn; + chn.set_audio (limit); + chn.set_midi (_input->n_ports().n_midi()); + bufs.set_count (chn); } /* don't waste time with automation if we're recording or we've just stopped (yes it can happen) */ diff --git a/libs/ardour/internal_send.cc b/libs/ardour/internal_send.cc index bbf15166d4..ad56622fc7 100644 --- a/libs/ardour/internal_send.cc +++ b/libs/ardour/internal_send.cc @@ -230,7 +230,7 @@ bool InternalSend::configure_io (ChanCount in, ChanCount out) { bool ret = Send::configure_io (in, out); - set_block_size (_session.get_block_size()); + set_block_size (_session.engine().frames_per_cycle()); return ret; } diff --git a/libs/ardour/route.cc b/libs/ardour/route.cc index e9c09e33bb..e1c85bf968 100644 --- a/libs/ardour/route.cc +++ b/libs/ardour/route.cc @@ -1341,7 +1341,6 @@ Route::configure_processors_unlocked (ProcessorStreams* err) // Ensure route outputs match last processor's outputs if (out != _output->n_ports ()) { - cerr << "For " << _name << " out/last mismatch - out = " << out << " vs. " << _output->n_ports() << endl; _output->ensure_io (out, false, this); } |