[MPlayer-users] small SAMI bugs

Evgeny Chukreev codedj at echo.ru
Tue Oct 30 04:40:15 CET 2001


On Tue, 30 Oct 2001 00:53:52 +0600 Evgeny Chukreev <codedj at echo.ru> wrote:

What a...? Where is the patch which I sent? (in MIME format)

Just again:

diff -urN MPlayer-20011028/subreader.c MPlayer-20011028.new/subreader.c
--- MPlayer-20011028/subreader.c	Sat Oct 27 05:14:19 2001
+++ MPlayer-20011028.new/subreader.c	Tue Oct 30 00:15:28 2001
@@ -89,16 +89,21 @@
  
 	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' || *s == '\n') { *p++ = ' '; s++; }
+	    else if (*s == '\r') { 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> */

EC> There is the fix for the SAMI reader.
EC> Fixes: <BR> breaks text, \t and \n are spaces,
EC> duplicated spaces goes to be replaced by one.

--
... Evgeny ... [finntroll - Bakom Varje Fura]



More information about the MPlayer-users mailing list