Mercurial > mplayer.hg
comparison subreader.c @ 6242:9c8c3b5e6658
possible sig11 fixed in .rt parser (weisskreuzova.zip)
author | arpi |
---|---|
date | Thu, 30 May 2002 17:44:58 +0000 |
parents | 86162cb34bc9 |
children | 0b8660d79efe |
comparison
equal
deleted
inserted
replaced
6241:34b3bdd52d01 | 6242:9c8c3b5e6658 |
---|---|
147 | 147 |
148 char *sub_readtext(char *source, char **dest) { | 148 char *sub_readtext(char *source, char **dest) { |
149 int len=0; | 149 int len=0; |
150 char *p=source; | 150 char *p=source; |
151 | 151 |
152 // printf("src=%p dest=%p \n",source,dest); | |
153 | |
152 while ( !eol(*p) && *p!= '|' ) { | 154 while ( !eol(*p) && *p!= '|' ) { |
153 p++,len++; | 155 p++,len++; |
154 } | 156 } |
155 | 157 |
156 *dest= (char *)malloc (len+1); | 158 *dest= (char *)malloc (len+1); |
356 continue; | 358 continue; |
357 current->start = a1*360000+a2*6000+a3*100+a4/10; | 359 current->start = a1*360000+a2*6000+a3*100+a4/10; |
358 current->end = b1*360000+b2*6000+b3*100+b4/10; | 360 current->end = b1*360000+b2*6000+b3*100+b4/10; |
359 p=line; p+=plen;i=0; | 361 p=line; p+=plen;i=0; |
360 // TODO: I don't know what kind of convention is here for marking multiline subs, maybe <br/> like in xml? | 362 // TODO: I don't know what kind of convention is here for marking multiline subs, maybe <br/> like in xml? |
361 next = strstr(line,"<clear/>")+8;i=0; | 363 next = strstr(line,"<clear/>"); |
362 while ((next =sub_readtext (next, &(current->text[i])))) { | 364 if(next && strlen(next)>8){ |
365 next+=8;i=0; | |
366 while ((next =sub_readtext (next, &(current->text[i])))) { | |
363 if (current->text[i]==ERR) {return ERR;} | 367 if (current->text[i]==ERR) {return ERR;} |
364 i++; | 368 i++; |
365 if (i>=SUB_MAX_TEXT) { printf ("Too many lines in a subtitle\n");current->lines=i;return current;} | 369 if (i>=SUB_MAX_TEXT) { printf ("Too many lines in a subtitle\n");current->lines=i;return current;} |
370 } | |
366 } | 371 } |
367 current->lines=i+1; | 372 current->lines=i+1; |
368 } | 373 } |
369 return current; | 374 return current; |
370 } | 375 } |