From fc49a93e9b74efc399fe7f3b94cce977955b53f9 Mon Sep 17 00:00:00 2001 From: Grigori Goronzy Date: Tue, 1 Sep 2015 02:12:19 +0200 Subject: fontselect: stop font selection after first match --- libass/ass_fontselect.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'libass') diff --git a/libass/ass_fontselect.c b/libass/ass_fontselect.c index c2686bd..955d5f6 100644 --- a/libass/ass_fontselect.c +++ b/libass/ass_fontselect.c @@ -560,6 +560,11 @@ static char *select_font(ASS_FontSelector *priv, ASS_Library *library, if (score == 0) break; } + + // The list of names is sorted by priority. If we matched anything, + // we can and should stop. + if (selected != NULL) + break; } // found anything? -- cgit v1.2.3