summaryrefslogtreecommitdiffstats
path: root/libass/ass_utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'libass/ass_utils.c')
-rw-r--r--libass/ass_utils.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/libass/ass_utils.c b/libass/ass_utils.c
index ba31261..3dab74c 100644
--- a/libass/ass_utils.c
+++ b/libass/ass_utils.c
@@ -205,14 +205,20 @@ unsigned ass_utf8_get_char(char **str)
* \param track track
* \param name style name
* \return index in track->styles
- * Returnes 0 if no styles found => expects at least 1 style.
- * Parsing code always adds "Default" style in the end.
+ * Returns 0 if no styles found => expects at least 1 style.
+ * Parsing code always adds "Default" style in the beginning.
*/
int lookup_style(ASS_Track *track, char *name)
{
int i;
- if (*name == '*')
- ++name; // FIXME: what does '*' really mean ?
+ // '*' seem to mean literally nothing;
+ // VSFilter removes them as soon as it can
+ while (*name == '*')
+ ++name;
+ // VSFilter then normalizes the case of "Default"
+ // (only in contexts where this function is called)
+ if (strcasecmp(name, "Default") == 0)
+ name = "Default";
for (i = track->n_styles - 1; i >= 0; --i) {
if (strcmp(track->styles[i].Name, name) == 0)
return i;
@@ -221,7 +227,7 @@ int lookup_style(ASS_Track *track, char *name)
ass_msg(track->library, MSGL_WARN,
"[%p]: Warning: no style named '%s' found, using '%s'",
track, name, track->styles[i].Name);
- return i; // use the first style
+ return i;
}
/**