Reset port resampler after freewheeling
This clears out any data potently left there by export processing. Previously this could cause an audible click.
This commit is contained in:
parent
b26f0b3e85
commit
1809b6ae9a
@ -42,6 +42,9 @@ public:
|
||||
void cycle_end (pframes_t);
|
||||
void cycle_split ();
|
||||
|
||||
/* reset SRC, clear out any state */
|
||||
void reinit ();
|
||||
|
||||
Buffer& get_buffer (pframes_t nframes) {
|
||||
return get_audio_buffer (nframes);
|
||||
}
|
||||
@ -53,6 +56,7 @@ protected:
|
||||
friend class PortManager;
|
||||
AudioPort (std::string const &, PortFlags);
|
||||
|
||||
|
||||
/* special access for PortManager only (hah, C++) */
|
||||
Sample* engine_get_whole_audio_buffer ();
|
||||
|
||||
|
@ -121,6 +121,7 @@ public:
|
||||
virtual void cycle_start (pframes_t);
|
||||
virtual void cycle_end (pframes_t) = 0;
|
||||
virtual void cycle_split () = 0;
|
||||
virtual void reinit () {}
|
||||
virtual Buffer& get_buffer (pframes_t nframes) = 0;
|
||||
virtual void flush_buffers (pframes_t /*nframes*/) {}
|
||||
virtual void transport_stopped () {}
|
||||
|
@ -293,6 +293,8 @@ protected:
|
||||
*/
|
||||
void cycle_end (pframes_t nframes, Session* s = 0);
|
||||
|
||||
void reinit ();
|
||||
|
||||
void cycle_end_fade_out (gain_t, gain_t, pframes_t, Session* s = 0);
|
||||
|
||||
static std::string port_info_file ();
|
||||
|
@ -127,6 +127,12 @@ AudioPort::cycle_split ()
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
AudioPort::reinit ()
|
||||
{
|
||||
_src.reset ();
|
||||
}
|
||||
|
||||
AudioBuffer&
|
||||
AudioPort::get_audio_buffer (pframes_t nframes)
|
||||
{
|
||||
|
@ -1483,6 +1483,9 @@ AudioEngine::freewheel_callback (bool onoff)
|
||||
{
|
||||
DEBUG_TRACE (DEBUG::BackendCallbacks, string_compose (X_("freewheel callback onoff %1\n"), onoff));
|
||||
_freewheeling = onoff;
|
||||
if (!_freewheeling) {
|
||||
PortManager::reinit ();
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -1183,6 +1183,13 @@ PortManager::silence (pframes_t nframes, Session* s)
|
||||
}
|
||||
}
|
||||
}
|
||||
void
|
||||
PortManager::reinit ()
|
||||
{
|
||||
for (auto const& p : *_ports.reader ()) {
|
||||
p.second->reinit ();
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
PortManager::silence_outputs (pframes_t nframes)
|
||||
|
Loading…
Reference in New Issue
Block a user