Delayline: report if set_delay() actually changed the delay
This commit is contained in:
parent
5a2ea4d0e2
commit
eb6df8939d
@ -43,7 +43,7 @@ public:
|
||||
bool display_to_user() const { return false; }
|
||||
|
||||
void run (BufferSet&, samplepos_t, samplepos_t, double, pframes_t, bool);
|
||||
void set_delay(samplecnt_t signal_delay);
|
||||
bool set_delay(samplecnt_t signal_delay);
|
||||
samplecnt_t get_delay() { return _pending_delay; }
|
||||
|
||||
bool configure_io (ChanCount in, ChanCount out);
|
||||
|
@ -283,7 +283,7 @@ DelayLine::run (BufferSet& bufs, samplepos_t /* start_sample */, samplepos_t /*
|
||||
_delay = pending_delay;
|
||||
}
|
||||
|
||||
void
|
||||
bool
|
||||
DelayLine::set_delay(samplecnt_t signal_delay)
|
||||
{
|
||||
if (signal_delay < 0) {
|
||||
@ -291,13 +291,20 @@ DelayLine::set_delay(samplecnt_t signal_delay)
|
||||
cerr << "WARNING: latency compensation is not possible.\n";
|
||||
}
|
||||
|
||||
if (signal_delay == _pending_delay) {
|
||||
DEBUG_TRACE (DEBUG::LatencyCompensation,
|
||||
string_compose ("%1 set_delay - no change: %2 samples for %3 channels\n",
|
||||
name(), signal_delay, _configured_output.n_audio()));
|
||||
return false;
|
||||
}
|
||||
|
||||
DEBUG_TRACE (DEBUG::LatencyCompensation,
|
||||
string_compose ("%1 set_delay to %2 samples for %3 channels\n",
|
||||
name(), signal_delay, _configured_output.n_audio()));
|
||||
|
||||
if (signal_delay <= _bsiz) {
|
||||
_pending_delay = signal_delay;
|
||||
return;
|
||||
return true;
|
||||
}
|
||||
|
||||
if (_pending_bsiz) {
|
||||
@ -306,7 +313,7 @@ DelayLine::set_delay(samplecnt_t signal_delay)
|
||||
} else {
|
||||
_pending_delay = signal_delay;
|
||||
}
|
||||
return;
|
||||
return true;
|
||||
}
|
||||
|
||||
allocate_pending_buffers (signal_delay);
|
||||
@ -316,6 +323,8 @@ DelayLine::set_delay(samplecnt_t signal_delay)
|
||||
DEBUG_TRACE (DEBUG::LatencyCompensation,
|
||||
string_compose ("allocated buffer for %1 of size %2\n",
|
||||
name(), signal_delay));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
|
Loading…
Reference in New Issue
Block a user