From 38e76398626da0649b46b5153da887ba82107744 Mon Sep 17 00:00:00 2001 From: Michael Fabian 'Xaymar' Dirks Date: Sat, 28 Sep 2019 02:10:37 +0200 Subject: [PATCH] ffmpeg/tools: Actually use the score --- source/ffmpeg/tools.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/ffmpeg/tools.cpp b/source/ffmpeg/tools.cpp index b86b18e..8c3d572 100644 --- a/source/ffmpeg/tools.cpp +++ b/source/ffmpeg/tools.cpp @@ -365,7 +365,7 @@ AVPixelFormat ffmpeg::tools::get_best_compatible_format(const AVPixelFormat* lis for (auto fmt = list; fmt && (*fmt != AV_PIX_FMT_NONE); fmt++) { auto found = format_compatibility.find(std::pair{source, *fmt}); - if (found != format_compatibility.end()) { + if (found != format_compatibility.end() && (score < found->second)) { score = found->second; best = *fmt; }