From d4b0090850c204c3409fddd5bedd61af14ced226 Mon Sep 17 00:00:00 2001 From: Hector Martin Date: Sat, 4 Sep 2021 14:43:45 +0900 Subject: [PATCH] Cache the absence of ffmpeg_harvid Without this, absence of the transcode tool causes it to be searched for for every entry in the file picker. --- libs/ardour/video_tools_paths.cc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/libs/ardour/video_tools_paths.cc b/libs/ardour/video_tools_paths.cc index 5ef7a5caa8..b1b4f1d17a 100644 --- a/libs/ardour/video_tools_paths.cc +++ b/libs/ardour/video_tools_paths.cc @@ -145,10 +145,14 @@ bool ArdourVideoToolPaths::transcoder_exe (std::string &ffmpeg_exe, std::string &ffprobe_exe) { static bool _cached = false; + static bool _success = false; static std::string _ffmpeg_exe; static std::string _ffprobe_exe; if (_cached) { + if (!_success) + return false; + ffmpeg_exe = _ffmpeg_exe; ffprobe_exe = _ffprobe_exe; return true; @@ -214,10 +218,13 @@ ArdourVideoToolPaths::transcoder_exe (std::string &ffmpeg_exe, std::string &ffpr #endif if (_ffmpeg_exe.empty() || _ffprobe_exe.empty()) { + _cached = true; + _success = false; return false; } _cached = true; + _success = true; ffmpeg_exe = _ffmpeg_exe; ffprobe_exe = _ffprobe_exe;