mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 15:38:00 +02:00
respect audio thread pool size setting
This commit is contained in:
parent
c4e435a166
commit
d2ed3caf02
2 changed files with 6 additions and 3 deletions
|
@ -512,9 +512,12 @@ void AudioMixer::parseSettingsObject(const QJsonObject &settingsObject) {
|
||||||
const QString AUTO_THREADS = "auto_threads";
|
const QString AUTO_THREADS = "auto_threads";
|
||||||
bool autoThreads = audioThreadingGroupObject[AUTO_THREADS].toBool();
|
bool autoThreads = audioThreadingGroupObject[AUTO_THREADS].toBool();
|
||||||
if (!autoThreads) {
|
if (!autoThreads) {
|
||||||
|
bool ok;
|
||||||
const QString NUM_THREADS = "num_threads";
|
const QString NUM_THREADS = "num_threads";
|
||||||
int numThreads = audioThreadingGroupObject[NUM_THREADS].toInt();
|
int numThreads = audioThreadingGroupObject[NUM_THREADS].toString().toInt(&ok);
|
||||||
_slavePool.setNumThreads(numThreads);
|
if (ok) {
|
||||||
|
_slavePool.setNumThreads(numThreads);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -113,7 +113,7 @@ void AudioMixerSlavePool::setNumThreads(int numThreads) {
|
||||||
|
|
||||||
int clampedThreads = std::min(std::max(1, numThreads), maxThreads);
|
int clampedThreads = std::min(std::max(1, numThreads), maxThreads);
|
||||||
if (clampedThreads != numThreads) {
|
if (clampedThreads != numThreads) {
|
||||||
qWarning("%s: clamped to %d (was %d)", __FUNCTION__, numThreads, clampedThreads);
|
qWarning("%s: clamped to %d (was %d)", __FUNCTION__, clampedThreads, numThreads);
|
||||||
numThreads = clampedThreads;
|
numThreads = clampedThreads;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue