From ee6f714b3e040705df99c3781d16fa505c507568 Mon Sep 17 00:00:00 2001 From: paulfd Date: Sun, 8 Sep 2019 18:18:19 +0200 Subject: [PATCH] The filepool is better configured for VST applications --- sfizz/FilePool.cpp | 2 +- sfizz/FilePool.h | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/sfizz/FilePool.cpp b/sfizz/FilePool.cpp index 52fcfc07..f08c5dfc 100644 --- a/sfizz/FilePool.cpp +++ b/sfizz/FilePool.cpp @@ -96,7 +96,7 @@ void sfz::FilePool::loadingThread() noexcept { FileLoadingInformation fileToLoad {}; while (!quitThread) { - if (!loadingQueue.wait_dequeue_timed(fileToLoad, 100ms)) + if (!loadingQueue.wait_dequeue_timed(fileToLoad, 10ms)) continue; if (fileToLoad.voice == nullptr) { diff --git a/sfizz/FilePool.h b/sfizz/FilePool.h index a7b795df..a6295fd2 100644 --- a/sfizz/FilePool.h +++ b/sfizz/FilePool.h @@ -22,6 +22,7 @@ // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #pragma once +#include "Config.h" #include "Defaults.h" #include "LeakDetector.h" #include "AudioBuffer.h" @@ -67,7 +68,7 @@ private: unsigned ticket; }; - moodycamel::BlockingReaderWriterQueue loadingQueue; + moodycamel::BlockingReaderWriterQueue loadingQueue { config::numVoices }; void loadingThread() noexcept; std::thread fileLoadingThread; bool quitThread { false };