summaryrefslogtreecommitdiffstats
path: root/libass
diff options
context:
space:
mode:
authorGrigori Goronzy <greg@chown.ath.cx>2015-09-01 02:12:19 +0200
committerGrigori Goronzy <greg@chown.ath.cx>2015-09-01 14:34:21 +0200
commitfc49a93e9b74efc399fe7f3b94cce977955b53f9 (patch)
tree6195fac8822f3c69ee6185e1493f325c2c9a6792 /libass
parent2a45128601458dd6ec9df90d2825a1ba7a9cc176 (diff)
downloadlibass-fc49a93e9b74efc399fe7f3b94cce977955b53f9.tar.bz2
libass-fc49a93e9b74efc399fe7f3b94cce977955b53f9.tar.xz
fontselect: stop font selection after first match
Diffstat (limited to 'libass')
-rw-r--r--libass/ass_fontselect.c5
1 files changed, 5 insertions, 0 deletions
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?