comparison subreader.c @ 2140:885c9c802373

ssa worx fine. Testers needed :)))
author laaz
date Tue, 09 Oct 2001 00:18:20 +0000
parents a9e51734ea00
children fa62c11857e8
comparison
equal deleted inserted replaced
2139:e06cabbd1a9b 2140:885c9c802373
305 subtitle *sub_read_line_ssa(FILE *fd,subtitle *current) { 305 subtitle *sub_read_line_ssa(FILE *fd,subtitle *current) {
306 int hour1, min1, sec1, hunsec1, 306 int hour1, min1, sec1, hunsec1,
307 hour2, min2, sec2, hunsec2, nothing; 307 hour2, min2, sec2, hunsec2, nothing;
308 308
309 char line[1000], 309 char line[1000],
310 line2[1000]; 310 line3[1000],
311 *line2;
311 do { 312 do {
312 if (!fgets (line, 1000, fd)) return NULL; 313 if (!fgets (line, 1000, fd)) return NULL;
313 } while (sscanf (line, "Dialogue: Marked=%d,%d:%d:%d.%d,%d:%d:%d.%d," 314 } while (sscanf (line, "Dialogue: Marked=%d,%d:%d:%d.%d,%d:%d:%d.%d,"
314 "*Default,%d,%d,%d,%d,,%[^\n\r]", &nothing, &hour1, &min1, 315 "%[^\n\r]", &nothing,
315 &sec1, &hunsec1, 316 &hour1, &min1, &sec1, &hunsec1,
316 &hour2, &min2, &sec2, &hunsec2, &nothing, 317 &hour2, &min2, &sec2, &hunsec2,
317 &nothing, &nothing, &nothing, line2) < 14); 318 line3) < 9);
318 current->lines=1; 319 line2=strstr(line3,",,");
320 if (!line2) return NULL;
321 line2 ++;
322 line2 ++;
323
324 current->lines=1; // ez a kiraly!!!
319 current->start = 360000*hour1 + 6000*min1 + 100*sec1 + hunsec1; 325 current->start = 360000*hour1 + 6000*min1 + 100*sec1 + hunsec1;
320 current->end = 360000*hour2 + 6000*min2 + 100*sec2 + hunsec2; 326 current->end = 360000*hour2 + 6000*min2 + 100*sec2 + hunsec2;
321 current->text[0]=(char *) malloc(strlen(line2)+1); 327 current->text[0]=(char *) malloc(strlen(line2)+1);
322 strcpy(current->text[0],line2); 328 strcpy(current->text[0],line2);
323 329