mirror of
https://github.com/lubosz/overte.git
synced 2025-08-08 02:48:12 +02:00
Fix connects. Set down MIN_READS_TO_CONSIDER_INPUT_ALIVE to 10
This commit is contained in:
parent
c8a168c273
commit
d230a634b2
1 changed files with 5 additions and 9 deletions
|
@ -64,7 +64,7 @@ static const int RECEIVED_AUDIO_STREAM_CAPACITY_FRAMES = 100;
|
||||||
|
|
||||||
#if defined(Q_OS_ANDROID)
|
#if defined(Q_OS_ANDROID)
|
||||||
static const int CHECK_INPUT_READS_MSECS = 2000;
|
static const int CHECK_INPUT_READS_MSECS = 2000;
|
||||||
static const int MIN_READS_TO_CONSIDER_INPUT_ALIVE = 100;
|
static const int MIN_READS_TO_CONSIDER_INPUT_ALIVE = 10;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static const auto DEFAULT_POSITION_GETTER = []{ return Vectors::ZERO; };
|
static const auto DEFAULT_POSITION_GETTER = []{ return Vectors::ZERO; };
|
||||||
|
@ -239,7 +239,7 @@ AudioClient::AudioClient() :
|
||||||
|
|
||||||
// start a thread to detect any device changes
|
// start a thread to detect any device changes
|
||||||
_checkDevicesTimer = new QTimer(this);
|
_checkDevicesTimer = new QTimer(this);
|
||||||
connect(_checkDevicesTimer, &QTimer::timeout, [this] {
|
connect(_checkDevicesTimer, &QTimer::timeout, this, [this] {
|
||||||
QtConcurrent::run(QThreadPool::globalInstance(), [this] { checkDevices(); });
|
QtConcurrent::run(QThreadPool::globalInstance(), [this] { checkDevices(); });
|
||||||
});
|
});
|
||||||
const unsigned long DEVICE_CHECK_INTERVAL_MSECS = 2 * 1000;
|
const unsigned long DEVICE_CHECK_INTERVAL_MSECS = 2 * 1000;
|
||||||
|
@ -247,7 +247,7 @@ AudioClient::AudioClient() :
|
||||||
|
|
||||||
// start a thread to detect peak value changes
|
// start a thread to detect peak value changes
|
||||||
_checkPeakValuesTimer = new QTimer(this);
|
_checkPeakValuesTimer = new QTimer(this);
|
||||||
connect(_checkPeakValuesTimer, &QTimer::timeout, [this] {
|
connect(_checkPeakValuesTimer, &QTimer::timeout, this, [this] {
|
||||||
QtConcurrent::run(QThreadPool::globalInstance(), [this] { checkPeakValues(); });
|
QtConcurrent::run(QThreadPool::globalInstance(), [this] { checkPeakValues(); });
|
||||||
});
|
});
|
||||||
const unsigned long PEAK_VALUES_CHECK_INTERVAL_MSECS = 50;
|
const unsigned long PEAK_VALUES_CHECK_INTERVAL_MSECS = 50;
|
||||||
|
@ -648,9 +648,7 @@ void AudioClient::start() {
|
||||||
qCDebug(audioclient) << "The closest format available is" << outputDeviceInfo.nearestFormat(_desiredOutputFormat);
|
qCDebug(audioclient) << "The closest format available is" << outputDeviceInfo.nearestFormat(_desiredOutputFormat);
|
||||||
}
|
}
|
||||||
#if defined(Q_OS_ANDROID)
|
#if defined(Q_OS_ANDROID)
|
||||||
connect(&_checkInputTimer, &QTimer::timeout, [this] {
|
connect(&_checkInputTimer, &QTimer::timeout, this, &AudioClient::checkInputTimeout);
|
||||||
checkInputTimeout();
|
|
||||||
});
|
|
||||||
_checkInputTimer.start(CHECK_INPUT_READS_MSECS);
|
_checkInputTimer.start(CHECK_INPUT_READS_MSECS);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -1572,9 +1570,7 @@ bool AudioClient::switchInputToAudioDevice(const QAudioDeviceInfo inputDeviceInf
|
||||||
#if defined(Q_OS_ANDROID)
|
#if defined(Q_OS_ANDROID)
|
||||||
if (_audioInput) {
|
if (_audioInput) {
|
||||||
_shouldRestartInputSetup = true;
|
_shouldRestartInputSetup = true;
|
||||||
connect(_audioInput, &QAudioInput::stateChanged, [this](QAudio::State state) {
|
connect(_audioInput, &QAudioInput::stateChanged, this, &AudioClient::audioInputStateChanged);
|
||||||
audioInputStateChanged(state);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
_inputDevice = _audioInput->start();
|
_inputDevice = _audioInput->start();
|
||||||
|
|
Loading…
Reference in a new issue