From aeef5ea24a9b42e9081f0ae7accc34660c05210e Mon Sep 17 00:00:00 2001 From: eyck Date: Tue, 22 May 2001 11:09:26 +0000 Subject: Preliminary support for RT-type subs. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@851 b3059339-0415-0410-9bf9-f77b7e298cf2 --- subreader.c | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 54 insertions(+), 5 deletions(-) (limited to 'subreader.c') diff --git a/subreader.c b/subreader.c index d0cb84567d..1a0c54cd03 100644 --- a/subreader.c +++ b/subreader.c @@ -24,6 +24,7 @@ int sub_format=-1; // 0 for microdvd // 2 for the third format (what's this?) // 3 for SAMI (smi) // 4 for vplayer format + // 5 for RT format int eol(char p) { return (p=='\r' || p=='\n' || p=='\0'); @@ -253,6 +254,46 @@ subtitle *sub_read_line_vplayer(FILE *fd,subtitle *current) { return current; } +subtitle *sub_read_line_rt(FILE *fd,subtitle *current) { + //TODO: This format uses quite rich (sub/super)set of xhtml + // I couldn't check it since DTD is not included. + // WARNING: full XML parses can be required for proper parsing + char line[1001]; + int a1,a2,a3,a4,b1,b2,b3,b4; + char *p=NULL,*next=NULL; + int i,len,plen; + + bzero (current, sizeof(current)); + + while (!current->text[0]) { + if (!fgets (line, 1000, fd)) return NULL; + //TODO: it seems that format of time is not easily determined, it may be 1:12, 1:12.0 or 0:1:12.0 + //to describe the same moment in time. Maybe there are even more formats in use. + //if ((len=sscanf (line, "