Skip to content

Commit

Permalink
Don't start loading jobs if hint_ram_based is set
Browse files Browse the repository at this point in the history
  • Loading branch information
pferrand-soundhound authored and paulfd committed Dec 26, 2023
1 parent be7c526 commit 1c77b96
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions src/sfizz/FilePool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -434,15 +434,18 @@ sfz::FileDataHolder sfz::FilePool::getFilePromise(const std::shared_ptr<FileId>&
DBG("[sfizz] File not found in the preloaded files: " << fileId->filename());
return {};
}
QueuedFileData queuedData { fileId, &preloaded->second };
if (!filesToLoad->try_push(queuedData)) {
DBG("[sfizz] Could not enqueue the file to load for " << fileId << " (queue capacity " << filesToLoad->capacity() << ")");
return {};
}

std::error_code ec;
dispatchBarrier.post(ec);
ASSERT(!ec);
if (!loadInRam) {
QueuedFileData queuedData { fileId, &preloaded->second };
if (!filesToLoad->try_push(queuedData)) {
DBG("[sfizz] Could not enqueue the file to load for " << fileId << " (queue capacity " << filesToLoad->capacity() << ")");
return {};
}

std::error_code ec;
dispatchBarrier.post(ec);
ASSERT(!ec);
}

return { &preloaded->second };
}
Expand Down

0 comments on commit 1c77b96

Please sign in to comment.