mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 15:09:24 +02:00
limit audio pool to sane thread count
This commit is contained in:
parent
259775e163
commit
28960681d9
1 changed files with 2 additions and 1 deletions
|
@ -129,7 +129,8 @@ void AudioMixerSlavePool::setNumThreads(int numThreads) {
|
||||||
int maxThreads = QThread::idealThreadCount();
|
int maxThreads = QThread::idealThreadCount();
|
||||||
if (maxThreads == -1) {
|
if (maxThreads == -1) {
|
||||||
// idealThreadCount returns -1 if cores cannot be detected
|
// idealThreadCount returns -1 if cores cannot be detected
|
||||||
maxThreads = std::numeric_limits<int>::max();
|
static const int MAX_THREADS_IF_UNKNOWN = 4;
|
||||||
|
maxThreads = MAX_THREADS_IF_UNKNOWN;
|
||||||
}
|
}
|
||||||
|
|
||||||
int clampedThreads = std::min(std::max(1, numThreads), maxThreads);
|
int clampedThreads = std::min(std::max(1, numThreads), maxThreads);
|
||||||
|
|
Loading…
Reference in a new issue