comparison subreader.c @ 5363:1f068f4bb6e7

vplayer sub fix by Arkadiusz Podgorski <wodzu@softomat.com.pl>
author arpi
date Wed, 27 Mar 2002 01:22:11 +0000
parents 712c8fc897fd
children 880008901169
comparison
equal deleted inserted replaced
5362:5882b38e1c2d 5363:1f068f4bb6e7
263 if ((len=sscanf (line, "%d:%d:%d%c%n",&a1,&a2,&a3,&separator,&plen)) < 4) 263 if ((len=sscanf (line, "%d:%d:%d%c%n",&a1,&a2,&a3,&separator,&plen)) < 4)
264 continue; 264 continue;
265 265
266 if (!(current->start = a1*360000+a2*6000+a3*100)) 266 if (!(current->start = a1*360000+a2*6000+a3*100))
267 continue; 267 continue;
268 /* removed by wodzu
268 p=line; 269 p=line;
269 // finds the body of the subtitle 270 // finds the body of the subtitle
270 for (i=0; i<3; i++){ 271 for (i=0; i<3; i++){
271 p=strchr(p,':'); 272 p=strchr(p,':');
272 if (p==NULL) break; 273 if (p==NULL) break;
274 } 275 }
275 if (p==NULL) { 276 if (p==NULL) {
276 printf("SUB: Skipping incorrect subtitle line!\n"); 277 printf("SUB: Skipping incorrect subtitle line!\n");
277 continue; 278 continue;
278 } 279 }
280 */
281 // by wodzu: hey! this time we know what length it has! what is
282 // that magic for? it can't deal with space instead of third
283 // colon! look, what simple it can be:
284 p = &line[ plen ];
279 285
280 i=0; 286 i=0;
281 if (*p!='|') { 287 if (*p!='|') {
282 // 288 //
283 next = p,i=0; 289 next = p,i=0;
486 if (sscanf (line, "%d:%d:%d,%d --> %d:%d:%d,%d", &i, &i, &i, &i, &i, &i, &i, &i)==8) 492 if (sscanf (line, "%d:%d:%d,%d --> %d:%d:%d,%d", &i, &i, &i, &i, &i, &i, &i, &i)==8)
487 {sub_uses_time=1;return SUB_SUBVIEWER;} 493 {sub_uses_time=1;return SUB_SUBVIEWER;}
488 if (strstr (line, "<SAMI>")) 494 if (strstr (line, "<SAMI>"))
489 {sub_uses_time=1; return SUB_SAMI;} 495 {sub_uses_time=1; return SUB_SAMI;}
490 if (sscanf (line, "%d:%d:%d:", &i, &i, &i )==3) 496 if (sscanf (line, "%d:%d:%d:", &i, &i, &i )==3)
497 {sub_uses_time=1;return SUB_VPLAYER;}
498 if (sscanf (line, "%d:%d:%d ", &i, &i, &i )==3)
491 {sub_uses_time=1;return SUB_VPLAYER;} 499 {sub_uses_time=1;return SUB_VPLAYER;}
492 //TODO: just checking if first line of sub starts with "<" is WAY 500 //TODO: just checking if first line of sub starts with "<" is WAY
493 // too weak test for RT 501 // too weak test for RT
494 // Please someone who knows the format of RT... FIX IT!!! 502 // Please someone who knows the format of RT... FIX IT!!!
495 // It may conflict with other sub formats in the future (actually it doesn't) 503 // It may conflict with other sub formats in the future (actually it doesn't)