diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2011-09-25 20:09:17 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2011-09-25 20:09:17 +0000 |
commit | 58ded03f8f5a9036e2b8263286261021eceb1ea2 (patch) | |
tree | 48891522b15d2cac93a19f11276cec7668f0739a /libs/ardour/track.cc | |
parent | 129ac54a57d2e68edcea16659c169d994dfba140 (diff) |
3.X version of earlier major fix to 2.X: Route::check_initial_delay() should be virtual and do nothing for busses
git-svn-id: svn://localhost/ardour2/branches/3.0@10123 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/track.cc')
-rw-r--r-- | libs/ardour/track.cc | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/libs/ardour/track.cc b/libs/ardour/track.cc index 6cbcc08714..4f682085b2 100644 --- a/libs/ardour/track.cc +++ b/libs/ardour/track.cc @@ -693,3 +693,40 @@ Track::maybe_declick (BufferSet& bufs, framecnt_t nframes, int declick) Amp::declick (bufs, nframes, declick); } } + +framecnt_t +Track::check_initial_delay (framecnt_t nframes, framecnt_t& transport_frame) +{ + if (_roll_delay > nframes) { + + _roll_delay -= nframes; + silence_unlocked (nframes); + /* transport frame is not legal for caller to use */ + return 0; + + } else if (_roll_delay > 0) { + + nframes -= _roll_delay; + silence_unlocked (_roll_delay); + transport_frame += _roll_delay; + + /* shuffle all the port buffers for things that lead "out" of this Route + to reflect that we just wrote _roll_delay frames of silence. + */ + + Glib::RWLock::ReaderLock lm (_processor_lock); + for (ProcessorList::iterator i = _processors.begin(); i != _processors.end(); ++i) { + boost::shared_ptr<IOProcessor> iop = boost::dynamic_pointer_cast<IOProcessor> (*i); + if (iop) { + iop->increment_port_buffer_offset (_roll_delay); + } + } + _output->increment_port_buffer_offset (_roll_delay); + + _roll_delay = 0; + + } + + return nframes; +} + |