aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar laaz <laaz@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-10-09 00:36:55 +0000
committerGravatar laaz <laaz@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-10-09 00:36:55 +0000
commit516a27f670c6fe8e59e7c81c6e5eb7e98dcf84eb (patch)
treee8a865c5d37eb96d28f4064e5cdee03ed574773d
parenta86edc5af938d62d60af928288066f19bba1ed85 (diff)
SSA 2. felvonas (egyre jobban programozok!!!)
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@2142 b3059339-0415-0410-9bf9-f77b7e298cf2
-rw-r--r--subreader.c21
1 files changed, 18 insertions, 3 deletions
diff --git a/subreader.c b/subreader.c
index e93f0989f1..12a7d4bebd 100644
--- a/subreader.c
+++ b/subreader.c
@@ -305,10 +305,13 @@ subtitle *sub_read_line_rt(FILE *fd,subtitle *current) {
subtitle *sub_read_line_ssa(FILE *fd,subtitle *current) {
int hour1, min1, sec1, hunsec1,
hour2, min2, sec2, hunsec2, nothing;
+ int num;
char line[1000],
line3[1000],
*line2;
+ char *tmp;
+
do {
if (!fgets (line, 1000, fd)) return NULL;
} while (sscanf (line, "Dialogue: Marked=%d,%d:%d:%d.%d,%d:%d:%d.%d,"
@@ -321,11 +324,23 @@ subtitle *sub_read_line_ssa(FILE *fd,subtitle *current) {
line2 ++;
line2 ++;
- current->lines=1; // ez a kiraly!!!
+ current->lines=1;num=0;
current->start = 360000*hour1 + 6000*min1 + 100*sec1 + hunsec1;
current->end = 360000*hour2 + 6000*min2 + 100*sec2 + hunsec2;
- current->text[0]=(char *) malloc(strlen(line2)+1);
- strcpy(current->text[0],line2);
+
+ while (tmp=strstr(line2, "\\n")) {
+ current->text[num]=(char *)malloc(tmp-line2+1);
+ strncpy (current->text[num], line2, tmp-line2);
+ current->text[num][tmp-line2]='\0';
+ line2=tmp+2;
+ num++;
+ current->lines++;
+ if (current->lines >= SUB_MAX_TEXT) return current;
+ }
+
+
+ current->text[num]=(char *) malloc(strlen(line2)+1);
+ strcpy(current->text[num],line2);
return current;
}