1
mirror of https://github.com/mpv-player/mpv synced 2024-09-05 02:48:21 +02:00

Applied SAMI patch by Evgeny Chukreev <codedj at echo dot ru>

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@2837 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
atmos4 2001-11-11 15:41:17 +00:00
parent 1ffb6bfa2b
commit ee898ac2f9

View File

@ -89,16 +89,21 @@ subtitle *sub_read_line_sami(FILE *fd, subtitle *current) {
case 3: /* get all text until '<' appears */
if (*s == '\0') { break; }
else if (*s == '<') { state = 4; }
else if (!strncasecmp (s, "&nbsp;", 6)) { *p++ = ' '; s += 6; }
else if (*s == '\r') { s++; }
else if (!strncasecmp (s, "<br>", 4) || *s == '\n') {
else if (!strncasecmp (s, "<br>", 4)) {
*p = '\0'; p = text; trail_space (text);
if (text[0] != '\0')
current->text[current->lines++] = strdup (text);
if (*s == '\n') s++; else s += 4;
s += 4;
}
else if (*s == '<') { state = 4; }
else if (!strncasecmp (s, "&nbsp;", 6)) { *p++ = ' '; s += 6; }
else if (*s == '\t') { *p++ = ' '; s++; }
else if (*s == '\r' || *s == '\n') { s++; }
else *p++ = *s++;
/* skip duplicated space */
if (p > text + 2) if (*(p-1) == ' ' && *(p-2) == ' ') p--;
continue;
case 4: /* get current->end or skip <TAG> */