From 555145471d9c010b48c4e8d74e4892f4fd40c232 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Devernay?= Date: Tue, 4 Jul 2017 15:29:17 +0200 Subject: [PATCH] KnobChoice::choiceMatch: bug fix --- Engine/KnobTypes.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Engine/KnobTypes.cpp b/Engine/KnobTypes.cpp index 6b4aa0e3b9..6fb47e328d 100644 --- a/Engine/KnobTypes.cpp +++ b/Engine/KnobTypes.cpp @@ -983,6 +983,9 @@ bool BothAreSpaces(char lhs, char rhs) { return (lhs == rhs) && (lhs == ' '); } // 5- paren/bracket-insensitive match (for WriteFFmpeg's format and codecs) // 6- if the choice ends with " 1" try to match exactly everything before that (for formats with PAR=1, where the PAR was removed) // returns index if choice was matched, -1 if not matched +#pragma message WARN("choiceMatch() should be moved into filterKnobChoiceOptionCompat().") +// TODO: choiceMatch() should be moved into filterKnobChoiceOptionCompat() +// TODO: filterKnobChoiceOptionCompat() should be used everywhere instead of choiceMatch() int KnobChoice::choiceMatch(const std::string& choice, const std::vector& entries, @@ -1039,6 +1042,7 @@ KnobChoice::choiceMatch(const std::string& choice, if (matchedEntry) { *matchedEntry = entries[i]; } + return i; } }