[Mplayer-cvslog] CVS: main subreader.c,1.70,1.71

Atmosfear atmos4 at mplayerhq.hu
Sun Oct 6 02:46:50 CEST 2002


Update of /cvsroot/mplayer/main
In directory mail:/var/tmp.root/cvs-serv26853

Modified Files:
	subreader.c 
Log Message:
Skip html tags (like <i>) inside subviewer subtitles.


Index: subreader.c
===================================================================
RCS file: /cvsroot/mplayer/main/subreader.c,v
retrieving revision 1.70
retrieving revision 1.71
diff -u -r1.70 -r1.71
--- subreader.c	22 Sep 2002 02:33:22 -0000	1.70
+++ subreader.c	6 Oct 2002 00:46:47 -0000	1.71
@@ -239,9 +239,28 @@
 	    len=0;
 	    for (p=line; *p!='\n' && *p!='\r' && *p; p++,len++);
 	    if (len) {
-		current->text[i]=(char *)malloc (len+1);
+                int j=0,skip=0;
+		char *curptr=current->text[i]=(char *)malloc (len+1);
 		if (!current->text[i]) return ERR;
-		strncpy (current->text[i], line, len); current->text[i][len]='\0';
+		//strncpy (current->text[i], line, len); current->text[i][len]='\0';
+                for(j; j<len; j++) {
+		    /* let's filter html tags ::atmos */
+		    if(line[j]=='>') {
+			skip=0;
+			continue;
+		    }
+		    if(line[j]=='<') {
+			skip=1;
+			continue;
+		    }
+		    if(skip) {
+			continue;
+		    }
+		    *curptr=line[j];
+		    curptr++;
+		}
+		*curptr='\0';
+
 		i++;
 	    } else {
 		break;




More information about the MPlayer-cvslog mailing list