summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2015-04-07 05:19:28 +0200
committerRobin Gareus <robin@gareus.org>2015-04-07 05:25:18 +0200
commit6ba555c2f57fb793431aef0cedfbacf11d643a2b (patch)
tree259772a74a7deb4dc245e1af7079621d89d0ba50
parenta30696828302cd98fae4e7a2065c76b863c89286 (diff)
prevent double declicks (click after RecStop)
If there's port-latency > period-size, there is a split cycle with (this_event->action_frame - _transport_frame). Yet Session::check_declick_out() keeps PendingDeclickOut if StopPendingCapture is set. The route declick’ed twice: Once with the period-size and one with the remaining frames, which resulted in a click.
-rw-r--r--libs/ardour/ardour/route.h1
-rw-r--r--libs/ardour/route.cc12
2 files changed, 13 insertions, 0 deletions
diff --git a/libs/ardour/ardour/route.h b/libs/ardour/ardour/route.h
index 5d52fc0c52..21610cc27f 100644
--- a/libs/ardour/ardour/route.h
+++ b/libs/ardour/ardour/route.h
@@ -506,6 +506,7 @@ class LIBARDOUR_API Route : public SessionObject, public Automatable, public Rou
framecnt_t _signal_latency_at_amp_position;
framecnt_t _initial_delay;
framecnt_t _roll_delay;
+ bool _declicked_silent;
ProcessorList _processors;
mutable Glib::Threads::RWLock _processor_lock;
diff --git a/libs/ardour/route.cc b/libs/ardour/route.cc
index 36adbfa148..ab341b7f34 100644
--- a/libs/ardour/route.cc
+++ b/libs/ardour/route.cc
@@ -83,6 +83,7 @@ Route::Route (Session& sess, string name, Flag flg, DataType default_type)
, _signal_latency_at_amp_position (0)
, _initial_delay (0)
, _roll_delay (0)
+ , _declicked_silent (true)
, _flags (flg)
, _pending_declick (true)
, _meter_point (MeterPostFader)
@@ -465,7 +466,18 @@ Route::process_output_buffers (BufferSet& bufs,
GLOBAL DECLICK (for transport changes etc.)
----------------------------------------------------------------------------------------- */
+ if (_declickable && _declicked_silent && declick <= 0) {
+ bufs.silence (nframes, 0);
+ }
+
maybe_declick (bufs, nframes, declick);
+
+ if (declick < 0) {
+ _declicked_silent = true;
+ }
+ else if (declick > 0) {
+ _declicked_silent = false;
+ }
_pending_declick = 0;
/* -------------------------------------------------------------------------------------------