Reset loopback resampler when input device is changed

This commit is contained in:
Ken Cooke 2019-06-01 11:04:52 -07:00
parent f7236f0498
commit 451cf60e54

View file

@ -755,11 +755,6 @@ void AudioClient::stop() {
qCDebug(audioclient) << "AudioClient::stop(), requesting switchOutputToAudioDevice() to shut down";
switchOutputToAudioDevice(QAudioDeviceInfo(), true);
if (_loopbackResampler) {
delete _loopbackResampler;
_loopbackResampler = NULL;
}
// Stop triggering the checks
QObject::disconnect(_checkPeakValuesTimer, &QTimer::timeout, nullptr, nullptr);
QObject::disconnect(_checkDevicesTimer, &QTimer::timeout, nullptr, nullptr);
@ -1663,12 +1658,17 @@ bool AudioClient::switchInputToAudioDevice(const QAudioDeviceInfo inputDeviceInf
_dummyAudioInput = NULL;
}
// cleanup any resamplers
if (_inputToNetworkResampler) {
// if we were using an input to network resampler, delete it here
delete _inputToNetworkResampler;
_inputToNetworkResampler = NULL;
}
if (_loopbackResampler) {
delete _loopbackResampler;
_loopbackResampler = NULL;
}
if (_audioGate) {
delete _audioGate;
_audioGate = nullptr;