From 919f3710b113c284aef73eeddff53c700c5fc6dc Mon Sep 17 00:00:00 2001 From: arpi Date: Thu, 5 Dec 2002 00:07:59 +0000 Subject: dump subtitles in SAMI format patch by Salvatore Falco git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@8364 b3059339-0415-0410-9bf9-f77b7e298cf2 --- subreader.c | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) (limited to 'subreader.c') diff --git a/subreader.c b/subreader.c index 074403e10a..019e1fc4b8 100644 --- a/subreader.c +++ b/subreader.c @@ -1512,6 +1512,59 @@ void dump_jacosub(subtitle* subs, float fps) { mp_msg(MSGT_SUBREADER,MSGL_INFO,"SUB: Subtitles dumped in \'dumpsub.js\'.\n"); } +void dump_sami(subtitle* subs, float fps) { + int i,j; + FILE * fd; + subtitle * onesub; + unsigned long temp; + + if (!sub_uses_time && sub_fps == 0) + sub_fps = fps; + fd=fopen("dumpsub.smi","w"); + if(!fd) + { + perror("dump_jacosub: fopen"); + return; + } + fprintf(fd, "\n" + "\n" + " \n" + "\n" + "\n"); + for(i=0;istart; + if (!sub_uses_time) + temp = temp * 100 / sub_fps; + temp -= sub_delay * 100; + fprintf(fd,"\t\n" + "\t

", temp * 10); + + for(j=0;jlines;j++) + fprintf(fd,"%s%s",j ? "
" : "", onesub->text[j]); + + fprintf(fd,"\n"); + + temp=onesub->end; + if (!sub_uses_time) + temp = temp * 100 / sub_fps; + temp -= sub_delay * 100; + fprintf(fd,"\t\n" + "\t

 \n", temp * 10); + } + fprintf(fd, "\n" + "\n"); + fclose(fd); + mp_msg(MSGT_SUBREADER,MSGL_INFO,"SUB: Subtitles dumped in \'dumpsub.smi\'.\n"); +} + void sub_free( subtitle * subs ) { int i; -- cgit v1.2.3