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; }