diff options
author | Robin Gareus <robin@gareus.org> | 2017-09-30 16:45:45 +0200 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2017-09-30 16:45:45 +0200 |
commit | 5fa9f8b399726e248412ebcfdeb8ed751f5a48d4 (patch) | |
tree | d543ed6861cda53c943e989f2dab5274c8fd8223 /libs/ardour/route.cc | |
parent | 697d29cdc2a59c698d2771f1dbec9a726a123843 (diff) |
Towards fixing no_roll()
Currently ::roll() may actually be a ::no_roll() under some circumstances.
This can also happen during count-in:
transport_stopped () == transport_rolling()
and during latency-preroll:
Global session-transport speed != 0, some tracks already roll,
read data from disk and feed latent plugins.
but other non-latent tracks or busses don't roll and still have to
behave like the switch from no_roll() to roll() has not yet happened.
This changes the game WRT to monitoring as well, previously, Route:roll()
called Route::no_roll_unlocked () for conditions outlined above.
Now Track::no_roll_unlocked is called and in some cases wrongly clears
the buffers before the signal hits the disk-writer. (more work is needed
related to 61f8e53b)
On the upside this also fixes an issue with MidiTrack::no_roll not keeping
a lock while pushing data into the step-edit-ringbuffer.
This is also a step towards consolidating all entry points:
::roll(), ::no_roll(), ::silent_roll() in the Route class.
Diffstat (limited to 'libs/ardour/route.cc')
-rw-r--r-- | libs/ardour/route.cc | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/libs/ardour/route.cc b/libs/ardour/route.cc index f411631e9e..389809190a 100644 --- a/libs/ardour/route.cc +++ b/libs/ardour/route.cc @@ -3656,6 +3656,12 @@ Route::no_roll (pframes_t nframes, samplepos_t start_sample, samplepos_t end_sam return 0; } + return no_roll_unlocked (nframes, start_sample, end_sample, session_state_changing); +} + +int +Route::no_roll_unlocked (pframes_t nframes, samplepos_t start_sample, samplepos_t end_sample, bool session_state_changing) +{ if (!_active) { silence_unlocked (nframes); return 0; @@ -3676,14 +3682,6 @@ Route::no_roll (pframes_t nframes, samplepos_t start_sample, samplepos_t end_sam */ } - no_roll_unlocked (nframes, start_sample, end_sample); - - return 0; -} - -void -Route::no_roll_unlocked (pframes_t nframes, samplepos_t start_sample, samplepos_t end_sample) -{ BufferSet& bufs = _session.get_route_buffers (n_process_buffers()); fill_buffers_with_input (bufs, _input, nframes); @@ -3698,6 +3696,7 @@ Route::no_roll_unlocked (pframes_t nframes, samplepos_t start_sample, samplepos_ passthru (bufs, start_sample, end_sample, nframes, 0, true, false); flush_processor_buffers_locked (nframes); + return 0; } samplecnt_t @@ -3731,7 +3730,7 @@ Route::latency_preroll (pframes_t nframes, samplepos_t& start_sample, samplepos_ } if (latency_preroll > playback_latency ()) { - no_roll_unlocked (nframes, start_sample - latency_preroll, end_sample - latency_preroll); + no_roll_unlocked (nframes, start_sample - latency_preroll, end_sample - latency_preroll, false); return 0; } |