diff --git a/src/effects/backends/audiounit/audiounitmanifest.mm b/src/effects/backends/audiounit/audiounitmanifest.mm index dda59e053ba..a67da3658a7 100644 --- a/src/effects/backends/audiounit/audiounitmanifest.mm +++ b/src/effects/backends/audiounit/audiounitmanifest.mm @@ -25,18 +25,12 @@ const int TIMEOUT_MS = 2000; - QElapsedTimer timer; - timer.start(); - - while (manager.getAudioUnit() == nil) { - if (timer.elapsed() > TIMEOUT_MS) { - qWarning() << name() << "took more than" << TIMEOUT_MS - << "ms to initialize, skipping manifest initialization " - "for this effect. This means this effect will not " - "display any parameters and likely not be useful!"; - return; - } - QThread::msleep(10); + if (!manager.waitForAudioUnit(TIMEOUT_MS)) { + qWarning() << name() << "took more than" << TIMEOUT_MS + << "ms to initialize, skipping manifest initialization " + "for this effect. This means this effect will not " + "display any parameters and likely not be useful!"; + return; } AudioUnit audioUnit = manager.getAudioUnit();