comparison subreader.c @ 8862:356534b9e7d4

Since version 2.7 the file extension for JACOsub changed from '.js' to '.jss', to avoid confusion with javascript. There is also a new format for list_sub_file output; however this is used only in debugging subtitles code, while disabled in real life use. patch by <salvatore.falco@katamail.com>
author arpi
date Thu, 09 Jan 2003 19:25:05 +0000
parents 22d2f3c34025
children 1c44c46ed57f
comparison
equal deleted inserted replaced
8861:d2cb317c7f16 8862:356534b9e7d4
572 sub_readtext((char *) &line,&current->text[0]); 572 sub_readtext((char *) &line,&current->text[0]);
573 current->lines = 1; 573 current->lines = 1;
574 current->end = current->start; // will be corrected by next subtitle 574 current->end = current->start; // will be corrected by next subtitle
575 575
576 if (!fgets (line, LINE_LEN, fd)) 576 if (!fgets (line, LINE_LEN, fd))
577 return current;; 577 return current;
578 578
579 next = line,i=1; 579 next = line,i=1;
580 while ((next =sub_readtext (next, &(current->text[i])))) { 580 while ((next =sub_readtext (next, &(current->text[i])))) {
581 if (current->text[i]==ERR) {return ERR;} 581 if (current->text[i]==ERR) {return ERR;}
582 i++; 582 i++;
1304 ".TXT", 1304 ".TXT",
1305 ".ssa", 1305 ".ssa",
1306 ".SSA", 1306 ".SSA",
1307 ".aqt", 1307 ".aqt",
1308 ".AQT", 1308 ".AQT",
1309 ".js", 1309 ".jss",
1310 ".JS" }; 1310 ".JSS" };
1311 1311
1312 1312
1313 if ( fname == NULL ) return NULL; 1313 if ( fname == NULL ) return NULL;
1314 1314
1315 sub_name1=strrchr(fname,'.'); 1315 sub_name1=strrchr(fname,'.');
1354 void list_sub_file(subtitle* subs){ 1354 void list_sub_file(subtitle* subs){
1355 int i,j; 1355 int i,j;
1356 1356
1357 for(j=0;j<sub_num;j++){ 1357 for(j=0;j<sub_num;j++){
1358 subtitle* egysub=&subs[j]; 1358 subtitle* egysub=&subs[j];
1359 printf ("%i line%c (%li-%li) ", 1359 printf ("%i line%c (%li-%li)\n",
1360 egysub->lines, 1360 egysub->lines,
1361 (1==egysub->lines)?' ':'s', 1361 (1==egysub->lines)?' ':'s',
1362 egysub->start, 1362 egysub->start,
1363 egysub->end); 1363 egysub->end);
1364 for (i=0; i<egysub->lines; i++) { 1364 for (i=0; i<egysub->lines; i++) {
1365 printf ("%s%s",egysub->text[i], i==egysub->lines-1?"":" <BREAK> "); 1365 printf ("\t\t%d: %s%s", i,egysub->text[i], i==egysub->lines-1?"":" \n ");
1366 } 1366 }
1367 printf ("\n"); 1367 printf ("\n");
1368 } 1368 }
1369 1369
1370 printf ("Subtitle format %s time.\n", sub_uses_time?"uses":"doesn't use"); 1370 printf ("Subtitle format %s time.\n", sub_uses_time?"uses":"doesn't use");
1508 subtitle * onesub; 1508 subtitle * onesub;
1509 unsigned long temp; 1509 unsigned long temp;
1510 1510
1511 if (!sub_uses_time && sub_fps == 0) 1511 if (!sub_uses_time && sub_fps == 0)
1512 sub_fps = fps; 1512 sub_fps = fps;
1513 fd=fopen("dumpsub.js","w"); 1513 fd=fopen("dumpsub.jss","w");
1514 if(!fd) 1514 if(!fd)
1515 { 1515 {
1516 perror("dump_jacosub: fopen"); 1516 perror("dump_jacosub: fopen");
1517 return; 1517 return;
1518 } 1518 }