diff --git a/libraries/ui/src/ui/OffscreenQmlSurface.cpp b/libraries/ui/src/ui/OffscreenQmlSurface.cpp index 2f5d0197bb..019897e5c3 100644 --- a/libraries/ui/src/ui/OffscreenQmlSurface.cpp +++ b/libraries/ui/src/ui/OffscreenQmlSurface.cpp @@ -140,9 +140,7 @@ public: } auto rootItem = _surface->getRootItem(); if (rootItem) { - auto children = rootItem->findChildren(); - for (int i = 0; i < children.size(); i++) { - auto player = children[i]; + for (auto player : rootItem->findChildren()) { auto mediaState = player->state(); QMediaService *svc = player->service(); if (nullptr == svc) { @@ -704,7 +702,7 @@ void OffscreenQmlSurface::forceQmlAudioOutputDeviceUpdate() { } else { auto audioIO = DependencyManager::get(); QString deviceName = audioIO->getActiveAudioDevice(QAudio::AudioOutput).deviceName(); - int waitForAudioQmlMs = 500; + int waitForAudioQmlMs = 200; // The audio device need to be change using oth new AudioHandler(this, deviceName, waitForAudioQmlMs); }