diff --git a/rtengine/rtlensfun.cc b/rtengine/rtlensfun.cc index 665fbd199..7b959ce8b 100644 --- a/rtengine/rtlensfun.cc +++ b/rtengine/rtlensfun.cc @@ -500,6 +500,7 @@ std::unique_ptr LFDatabase::getModifier(const LFCamera &camera, cons return ret; } +std::set LFDatabase::notFound; std::unique_ptr LFDatabase::findModifier(const procparams::LensProfParams &lensProf, const FramesMetaData *idata, int width, int height, const procparams::CoarseTransformParams &coarse, int rawRotationDeg) { @@ -521,6 +522,11 @@ std::unique_ptr LFDatabase::findModifier(const procparams::LensProfP return nullptr; } + const std::string key = (make + model + lens).collate_key(); + if (notFound.find(key) != notFound.end()) { + // This combination was not found => do not search again + return nullptr; + } const LFDatabase *db = getInstance(); LFCamera c = db->findCamera(make, model); LFLens l = db->findLens(lensProf.lfAutoMatch() ? c : LFCamera(), lens); @@ -549,6 +555,10 @@ std::unique_ptr LFDatabase::findModifier(const procparams::LensProfP << (ret ? ret->getDisplayString() : "NONE") << std::endl; } + if (!ret) { + notFound.emplace(key); + } + return ret; } diff --git a/rtengine/rtlensfun.h b/rtengine/rtlensfun.h index 7dcd96007..573b93fca 100644 --- a/rtengine/rtlensfun.h +++ b/rtengine/rtlensfun.h @@ -21,6 +21,7 @@ #pragma once #include +#include #include #include @@ -135,6 +136,7 @@ private: mutable MyMutex lfDBMutex; static LFDatabase instance_; lfDatabase *data_; + static std::set notFound; }; } // namespace rtengine