[Mplayer-cvslog] CVS: main subreader.c,1.16,1.17

Megyer Laszlo laaz at users.sourceforge.net
Fri Jun 1 22:05:14 CEST 2001


Update of /cvsroot/mplayer/main
In directory usw-pr-cvs1:/tmp/cvs-serv24128

Modified Files:
	subreader.c 
Log Message:
more stabile


Index: subreader.c
===================================================================
RCS file: /cvsroot/mplayer/main/subreader.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -r1.16 -r1.17
*** subreader.c	2001/05/31 18:08:23	1.16
--- subreader.c	2001/06/01 20:05:12	1.17
***************
*** 111,117 ****
  char *sub_readtext(char *source, char **dest) {
      int len=0;
!     char *p;
      
!     for (p=source;*p!='\r' && *p!='\n' && *p!='|'; p++,len++);
      
      *dest= (char *)malloc (len+1);
--- 111,119 ----
  char *sub_readtext(char *source, char **dest) {
      int len=0;
!     char *p=source;
      
!     while ( !eol(*p) && *p!= '|' ) {
! 	p++,len++;
!     }
      
      *dest= (char *)malloc (len+1);
***************
*** 137,155 ****
      do {
  	if (!fgets (line, 1000, fd)) return NULL;
!     } while (*line=='\n' || *line == '\r' || !*line);
!     
!     if (sscanf (line, "{%ld}{%ld}%s", &(current->start), &(current->end),line2) <2) {return ERR;}
  
!     p=line;
!     while (*p++!='}');
!     while (*p++!='}');
  
      next=p, i=0;
!     while ((next =sub_readtext (next, &(current->text[i])))) {
          if (current->text[i]==ERR) {return ERR;}
  	i++;
  	if (i>=SUB_MAX_TEXT) { printf ("Too many lines in a subtitle\n");current->lines=i;return;}
      }
!     current->lines=i+1;
  
      return current;
--- 139,153 ----
      do {
  	if (!fgets (line, 1000, fd)) return NULL;
!     } while (sscanf (line, "{%ld}{%ld}%[^\r\n]", &(current->start), &(current->end),line2) <3);
  
!     p=line2;
  
      next=p, i=0;
!     while (next =sub_readtext (next, &(current->text[i]))) {
          if (current->text[i]==ERR) {return ERR;}
  	i++;
  	if (i>=SUB_MAX_TEXT) { printf ("Too many lines in a subtitle\n");current->lines=i;return;}
      }
!     current->lines= ++i;
  
      return current;


_______________________________________________
Mplayer-cvslog mailing list
Mplayer-cvslog at lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/mplayer-cvslog



More information about the MPlayer-cvslog mailing list