[Mplayer-cvslog] CVS: main subreader.c,1.1,1.2

GEREOFFY arpi_esp at users.sourceforge.net
Sun Apr 1 19:50:43 CEST 2001


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

Modified Files:
	subreader.c 
Log Message:
applied patch by lez

Index: subreader.c
===================================================================
RCS file: /cvsroot/mplayer/main/subreader.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** subreader.c	2001/03/30 03:07:45	1.1
--- subreader.c	2001/04/01 17:50:40	1.2
***************
*** 1,5 ****
  /*
   * Subtitle reader with format autodetection
-  * Mier nem muxik realloccal!?!?! - nekem muxik :)
   *
   * Written by laaz
--- 1,4 ----
***************
*** 55,59 ****
      } while (*line=='\n' || *line == '\r' || !*line);
      
!     if (sscanf (line, "{%i}{%i}%s", &(current->start), &(current->end),line2) <2) {return ERR;}
  
      p=line;
--- 54,58 ----
      } while (*line=='\n' || *line == '\r' || !*line);
      
!     if (sscanf (line, "{%d}{%d}%s", &(current->start), &(current->end),line2) <2) {return ERR;}
  
      p=line;
***************
*** 82,86 ****
      while (!current->text[0]) {
  	if (!fgets (line, 1000, fd)) return NULL;
! 	if (sscanf (line, "%i:%i:%i.%i,%i:%i:%i.%i",&a1,&a2,&a3,&a4,&b1,&b2,&b3,&b4) < 8) continue;
  	current->start = a1*360000+a2*6000+a3*100+a4;
  	current->end   = b1*360000+b2*6000+b3*100+b4;
--- 81,85 ----
      while (!current->text[0]) {
  	if (!fgets (line, 1000, fd)) return NULL;
! 	if (sscanf (line, "%d:%d:%d.%d,%d:%d:%d.%d",&a1,&a2,&a3,&a4,&b1,&b2,&b3,&b4) < 8) continue;
  	current->start = a1*360000+a2*6000+a3*100+a4;
  	current->end   = b1*360000+b2*6000+b3*100+b4;
***************
*** 111,120 ****
      while (!current->text[0]) {
  	if (!fgets (line, 1000, fd)) return NULL;
! 	if ((len=sscanf (line, "%i:%i:%i,%i --> %i:%i:%i,%i",&a1,&a2,&a3,&a4,&b1,&b2,&b3,&b4)) < 8)
  	    continue;
  	current->start = a1*360000+a2*6000+a3*100+a4/10;
  	current->end   = b1*360000+b2*6000+b3*100+b4/10;
  	for (i=0; i<SUB_MAX_TEXT;) {
! 	    if (!fgets (line, 1000, fd)) return NULL;
  	    len=0;
  	    for (p=line; *p!='\n' && *p!='\r' && *p; p++,len++);
--- 110,119 ----
      while (!current->text[0]) {
  	if (!fgets (line, 1000, fd)) return NULL;
! 	if ((len=sscanf (line, "%d:%d:%d,%d --> %d:%d:%d,%d",&a1,&a2,&a3,&a4,&b1,&b2,&b3,&b4)) < 8)
  	    continue;
  	current->start = a1*360000+a2*6000+a3*100+a4/10;
  	current->end   = b1*360000+b2*6000+b3*100+b4/10;
  	for (i=0; i<SUB_MAX_TEXT;) {
! 	    if (!fgets (line, 1000, fd)) break;
  	    len=0;
  	    for (p=line; *p!='\n' && *p!='\r' && *p; p++,len++);
***************
*** 145,153 ****
  
  //	if (sscanf (line, "{%i}{%i}", &i, &i, p)==2) // ha valaki tudja miert 2, mondja mar el nekem ;)
! 	if (sscanf (line, "{%i}{%i}", &i, &i)==2) // ha valaki tudja miert 2, mondja mar el nekem ;)
  		{sub_uses_time=0;return 0;}
! 	if (sscanf (line, "%i:%i:%i.%i,%i:%i:%i.%i",     &i, &i, &i, &i, &i, &i, &i, &i)==8)
  		{sub_uses_time=1;return 1;}
! 	if (sscanf (line, "%i:%i:%i,%i --> %i:%i:%i,%i", &i, &i, &i, &i, &i, &i, &i, &i)==8)
  		{sub_uses_time=1;return 2;}
  	if (j>100) return -1;  // too many bad lines or bad coder
--- 144,152 ----
  
  //	if (sscanf (line, "{%i}{%i}", &i, &i, p)==2) // ha valaki tudja miert 2, mondja mar el nekem ;)
! 	if (sscanf (line, "{%d}{%d}", &i, &i)==2) // ha valaki tudja miert 2, mondja mar el nekem ;)
  		{sub_uses_time=0;return 0;}
! 	if (sscanf (line, "%d:%d:%d.%d,%d:%d:%d.%d",     &i, &i, &i, &i, &i, &i, &i, &i)==8)
  		{sub_uses_time=1;return 1;}
! 	if (sscanf (line, "%d:%d:%d,%d --> %d:%d:%d,%d", &i, &i, &i, &i, &i, &i, &i, &i)==8)
  		{sub_uses_time=1;return 2;}
  	if (j>100) return -1;  // too many bad lines or bad coder
***************
*** 193,197 ****
  
  //    printf ("SUB: Subtitle format %s time.\n", sub_uses_time?"uses":"doesn't use");
!     printf ("SUB: Read %i subtitles, %i errors.\n", sub_num, sub_errs);
  
      return first;
--- 192,198 ----
  
  //    printf ("SUB: Subtitle format %s time.\n", sub_uses_time?"uses":"doesn't use");
!     printf ("SUB: Read %i subtitles", sub_num);
!     if (sub_errs) printf (", %i error(s).\n", sub_errs);
!     else 	  printf (".\n");
  
      return first;


_______________________________________________
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